From 950b4fc5ece60b4c2e2973f7ecb69d2cee37d2fa Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Thu, 9 Jul 2026 18:22:39 +0200 Subject: [PATCH] Move tests to bookworm Signed-off-by: Pol Henarejos --- src/openpgp/cmd_put_data.c | 2 +- tests/docker/bookworm/Dockerfile | 46 ++++++++++++++++++++++++++++++++ tests/docker/bullseye/Dockerfile | 1 - tests/docker_env.sh | 2 +- 4 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 tests/docker/bookworm/Dockerfile diff --git a/src/openpgp/cmd_put_data.c b/src/openpgp/cmd_put_data.c index 51a5afc..d26f8fc 100644 --- a/src/openpgp/cmd_put_data.c +++ b/src/openpgp/cmd_put_data.c @@ -76,7 +76,7 @@ int cmd_put_data(void) { uint16_t status_len = MIN(file_get_size(ef), sizeof(pw_status)); memcpy(pw_status, file_get_data(ef), status_len); } - memcpy(pw_status, apdu.data, MIN(apdu.nc, 4)); + memcpy(pw_status, apdu.data, MIN(apdu.nc, 4u)); r = file_put_data(ef, pw_status, sizeof(pw_status)); } else if (fid == EF_RC) { diff --git a/tests/docker/bookworm/Dockerfile b/tests/docker/bookworm/Dockerfile new file mode 100644 index 0000000..24f6076 --- /dev/null +++ b/tests/docker/bookworm/Dockerfile @@ -0,0 +1,46 @@ +FROM debian:bookworm + +ARG DEBIAN_FRONTEND=noninteractive + +RUN apt update && apt upgrade -y +RUN apt install -y apt-utils +RUN apt autoremove -y +RUN rm -rf /var/cache/apt/archives/* +RUN apt install -y libccid \ + libpcsclite-dev \ + git \ + autoconf \ + pkg-config \ + libtool \ + help2man \ + automake \ + gcc \ + make \ + build-essential \ + opensc \ + python3 \ + python3-pip \ + swig \ + cmake \ + vsmartcard-vpcd \ + libgcrypt-dev \ + libssl-dev \ + check \ + gengetopt \ + libtss2-dev \ + tpm2-tools \ + swtpm \ + && rm -rf /var/lib/apt/lists/* +RUN pip3 install pytest pycvc cryptography pyscard --break-system-packages +RUN git clone https://github.com/Yubico/yubico-piv-tool +WORKDIR /yubico-piv-tool +RUN git checkout tags/yubico-piv-tool-2.5.1 +ADD tests/docker/jammy/yubico-piv-tool.patch /yubico-piv-tool/yubico-piv-tool.patch +RUN git apply yubico-piv-tool.patch +RUN mkdir build +WORKDIR /yubico-piv-tool/build +RUN cmake .. -DENABLE_HARDWARE_TESTS=1 +RUN make -j`nproc` +RUN make install +WORKDIR / +RUN ldconfig diff --git a/tests/docker/bullseye/Dockerfile b/tests/docker/bullseye/Dockerfile index ea4119b..322318a 100644 --- a/tests/docker/bullseye/Dockerfile +++ b/tests/docker/bullseye/Dockerfile @@ -29,7 +29,6 @@ RUN apt install -y libccid \ gengetopt \ libtss2-dev \ tpm2-tools \ - swtpm \ && rm -rf /var/lib/apt/lists/* RUN pip3 install pytest pycvc cryptography pyscard RUN git clone https://github.com/Yubico/yubico-piv-tool diff --git a/tests/docker_env.sh b/tests/docker_env.sh index 2f05b59..6bc2af1 100644 --- a/tests/docker_env.sh +++ b/tests/docker_env.sh @@ -46,7 +46,7 @@ # default values, can be overridden by the environment -: ${MBEDTLS_DOCKER_GUEST:=bullseye} +: ${MBEDTLS_DOCKER_GUEST:=bookworm} DOCKER_IMAGE_TAG="pico-openpgp-test:${MBEDTLS_DOCKER_GUEST}"