Skip to content

Commit a6b4a40

Browse files
committed
add Dockerfile to run test suite manually
1 parent b206c44 commit a6b4a40

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

Dockerfile

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
ARG IMAGE=debian:stable
2+
FROM $IMAGE
3+
4+
RUN apt-get update && \
5+
DEBIAN_FRONTEND="noninteractive" apt-get install -y gcc python3 python3-dev softhsm2 openssl && \
6+
rm -rf /var/lib/apt/lists/*
7+
8+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
9+
10+
WORKDIR /test
11+
12+
ADD uv.lock pyproject.toml setup.py .
13+
ADD pkcs11/ pkcs11/
14+
ADD extern/ extern/
15+
16+
ENV UV_LINK_MODE=copy
17+
RUN --mount=type=cache,target=/root/.cache/uv \
18+
uv sync --all-extras
19+
20+
ENV PKCS11_MODULE=/usr/lib/softhsm/libsofthsm2.so
21+
ENV PKCS11_TOKEN_LABEL=TEST
22+
ENV PKCS11_TOKEN_PIN=1234
23+
ENV PKCS11_TOKEN_SO_PIN=5678
24+
RUN softhsm2-util --init-token --free --label TEST --pin 1234 --so-pin 5678
25+
26+
ADD tests/ tests/
27+
CMD ["uv", "run", "pytest", "-v"]

0 commit comments

Comments
 (0)