Skip to content

Development and Testing

krisjanisp edited this page Oct 9, 2026 · 7 revisions

Development and testing

cargo fmt --check
cargo clippy --locked --all-targets -- -D warnings
cargo test --locked
cargo build --locked
cargo clippy --locked --all-targets --features gui -- -D warnings   # dashboard; CI runs it on Windows
python3 tests/setup.py
python3 tests/https.py
python3 tests/mtls.py
python3 tests/psk.py

The Rust executable tests also cover CSR generation and external CA signing, certificate installation, wrong-key rejection, secret preservation on reruns, PSK import, client CA management, SAE conflicts, configuration-relative paths, and real two-endpoint mTLS demo verification (including wrong-PSK failure). These run on both Linux and Windows as part of cargo test --locked. Users can run qkd-stub demo init, start the two generated configurations, and run qkd-stub demo verify without installing test tools; see Standalone provisioning.

The Rust tests cover the API, UUID validation, independent fixed vectors, SAE authorization, and mandatory PSK configuration. HTTPS tests check transport, both directions, restarts, certificate mappings and invalid clients. PSK tests use OpenSSL AES and an independent Python HMAC/HKDF implementation to verify encrypted IDs, checksums and keys, both methods, the full key-size range, damaged IDs, atomic batch rejection, wrong PSKs, and restart recovery.

The Python tests start the server with --config FILE serve and create OpenSSL test credentials with scripts/gen-*. qkd-stub demo verify checks two running demo endpoints. QKD_STUB_BIN selects an alternate binary for the Python tests.

Ubuntu setup and the container check are on the Ubuntu prerequisites page. cargo fmt and cargo clippy need rustup component add rustfmt clippy. The Python tests need Python 3.11+.

Ubuntu and Windows tests run on code pushes and all pull requests, and can also be started manually. Pushes that change only docs/** or Markdown files skip the test workflows.

Clone this wiki locally