Testing RMS
RMS has unit tests, four integration test binaries, and Criterion scale benchmarks. Most tests run against an in-process backend with no external dependencies; only the Postgres persistence suite needs a real database.
Prerequisites
Networking
The integration suites (grpc_e2e, grpc_mtls, mockup_server_test) start an
in-process Redfish simulator that serves BMC endpoints over real HTTPS on
loopback, binding one TLS port per simulated BMC. No outbound network access or
real hardware is required, but the tests do bind local TCP ports.
Postgres (for persistence tests)
The persistence suite’s Postgres backend requires a reachable Postgres 16 and a
DATABASE_URL. The bundled
docker-compose.yml
pulls postgres:16-alpine, listens on localhost:5432, and uses credentials
postgres / postgres / rms_test:
cargo test --test persistence provisions a fresh, isolated ephemeral database
per test (via #[sqlx::test]) and drops it afterward, so no manual reset is
needed between runs. To reset the shared rms_test database used by the
binary, see Configuring RMS: Postgres.
Run everything
Matching CI, use release mode with DATABASE_URL set so the persistence suite
runs against a real database:
This runs the unit tests plus all four integration binaries.
Run without a database
Skip the Postgres-backed persistence tests by listing the suites that don’t need one (the memory backend of the persistence suite always runs):
Unit tests
Integration tests
The Redfish simulator
Redfish tests and benchmarks use the redfish_test_support workspace crate. It
serves static Redfish JSON from mockup device trees over TLS (self-signed certs
generated at startup via rcgen + tokio-rustls), simulates firmware update
tasks with a configurable delay and failure rate, and supports multi-port binding
so each simulated BMC gets its own TLS endpoint. It starts in-process in
milliseconds with zero external dependencies. Fixture data lives under
crates/redfish_test_support/fixtures/mockup/.
Benchmarks
Criterion scale benchmarks measure RMS performance from 100 to 10,000 nodes. Each benchmark node gets its own mockup BMC on a unique port, forcing independent TLS sessions - matching production, where each node talks to a different BMC.
Running tests in Docker
The builder image encapsulates the toolchain, so results match CI without installing Rust on the host: