Skip to content

PKCS #11 relay: one script to run the tests on macOS and Linux - #59

Merged
JoeShook merged 2 commits into
pkcs11-reconnectfrom
pkcs11-relay-shell-script
Nov 16, 2026
Merged

JoeShook merged 2 commits into
pkcs11-reconnectfrom
pkcs11-relay-shell-script

Conversation

@JoeShook

@JoeShook JoeShook commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

tools/pkcs11-relay/run-token-tests.sh does on macOS and Linux what run-token-tests.ps1 does on Windows: it builds the relay client library for the machine it runs on, starts the relay server with SoftHSM in a container, runs the PKCS #11 tests through it (including the reconnect tests) and removes the container.

Builds on #57, which this is based on; merge that first.

  • Script: picks osx-arm64, osx-x64, linux-x64 or linux-arm64 from the machine. The first argument is the test filter; anything after it goes to dotnet test. PORT, FAULT_PORT and SERVER_LOG are optional settings.
  • CI: the relay job now runs this script instead of its own copy of the same steps, so the Linux path is checked on every change. The check that the tests really reached the relay reads the server log the script keeps.
  • Docs: the relay README and CLAUDE.md name the script.

Checked

  • Linux: the relay job in this pull request's CI run.
  • macOS (Apple Silicon): the script ran as written at its first commit. A plain run passed 23 of 23; a run with a filter, an extra dotnet test argument and SERVER_LOG passed the 5 reconnect tests and kept the log. No container was left behind either time. The wait for the server added afterwards has run on Linux in CI only.

🤖 Generated with Claude Code

https://claude.ai/code/session_015WNuLiokmqeoddhdh8X3As

JoeShook and others added 2 commits November 16, 2026 13:37
…cript

run-token-tests.sh does what run-token-tests.ps1 does on Windows: it builds
the relay client library for the machine it runs on, starts the relay server
with SoftHSM in a container, runs the PKCS #11 tests through it and removes
the container. CI's relay job now runs the same script, so the Linux path
developers use is the one that is checked on every change.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015WNuLiokmqeoddhdh8X3As
Docker accepts connections on a published port before the server in the
container is listening, so on a machine where the tests are already built
the first call could arrive too early. The script now waits for the
server's start-up line.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015WNuLiokmqeoddhdh8X3As
@JoeShook
JoeShook merged commit b0a649e into pkcs11-reconnect Nov 16, 2026
7 checks passed
@JoeShook
JoeShook deleted the pkcs11-relay-shell-script branch November 20, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant