Files
amethyst/quic/scripts/run-picoquic.sh
T
Claude d2a10c9e4a feat(quic): live interop harness — picoquic Docker + InteropRunner main
Setup for driving the pure-Kotlin QUIC client against real reference
servers, kicking off the live-interop validation that closes the loop on
the audit cycles.

PermissiveCertificateValidator (commonMain test-only):
  Accepts any cert chain and any signature. For local dev servers (picoquic,
  quic-go, nests-rs in Docker) where the system trust store would reject the
  self-signed cert. Documented as test-only — must never be wired into
  production code.

InteropRunner.main (jvmTest):
  Standalone runnable that opens a UDP socket, builds a QuicConnection with
  PermissiveCertificateValidator, drives the handshake under a configurable
  timeout, and reports CONNECTED / HandshakeFailed / Timeout / UdpFailed
  with peer transport parameters on success. Exit code 0 on connect, 1 on
  any failure mode — wirable into CI.

`quic/scripts/run-picoquic.sh`:
  One-line Docker harness that runs Christian Huitema's picoquic reference
  server on UDP 4433. Picoquic is the IETF QUIC WG's reference impl and
  the most permissive target for a fresh client (clear qlog traces, accepts
  a wide range of transport params).

`./gradlew :quic:interop` Gradle task:
  Wraps the runner so live-interop is one command:
    ./gradlew :quic:interop -PinteropHost=127.0.0.1 -PinteropPort=4433
  Validated against a non-running server: returns Timeout cleanly with
  exit 1 (the failure-path proves the harness wires correctly).

Workflow documented in `quic/scripts/README.md` covering picoquic,
quic-go, aioquic, quiche, and the eventual graduation path to the
quic-interop-runner Docker matrix at https://interop.seemann.io.

Next step: actually run picoquic in Docker and chase whatever real-world
incompatibilities surface. Each will be a focused fix commit.

https://claude.ai/code/session_01EC1tfXfap8k8GyKvrxkxZx
2026-04-25 23:08:18 +00:00

42 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
# Spin up Christian Huitema's picoquic reference server on UDP 4433.
# Picoquic is the IETF QUIC WG's reference impl and the most permissive
# server for a brand-new client to interop against — it logs detailed
# qlog traces and accepts a wide range of transport parameters.
#
# Usage:
# quic/scripts/run-picoquic.sh # foreground, ^C to stop
# quic/scripts/run-picoquic.sh -d # detached
#
# Then in another terminal, drive our client:
# ./gradlew :quic:jvmTest --tests '*InteropRunner*' \
# -DinteropHost=127.0.0.1 -DinteropPort=4433
#
# Or compile + run the runner main directly:
# ./gradlew :quic:jvmTestClasses
# java -cp 'quic/build/classes/kotlin/jvm/{main,test}:…' \
# com.vitorpamplona.quic.interop.InteropRunnerKt 127.0.0.1 4433
set -euo pipefail
DETACH=${1:-}
IMAGE="privateoctopus/picoquic:latest"
CONTAINER="amethyst-picoquic-interop"
echo "Pulling $IMAGE..."
docker pull "$IMAGE" >/dev/null
# Stop any prior instance so re-runs are idempotent.
docker rm -f "$CONTAINER" 2>/dev/null || true
if [ "$DETACH" = "-d" ]; then
docker run -d --name "$CONTAINER" -p 4433:4433/udp "$IMAGE" \
picoquicdemo -p 4433
echo "picoquic started (container=$CONTAINER) on UDP 4433"
echo "Stop with: docker rm -f $CONTAINER"
else
exec docker run --rm --name "$CONTAINER" -p 4433:4433/udp "$IMAGE" \
picoquicdemo -p 4433
fi