Skip to content

mock servers

Thomas Mangin edited this page May 29, 2026 · 3 revisions

Pre-Alpha. This page describes behavior that may change.

ze-test is the test harness for Ze. Beyond driving the .ci functional test files, it bundles a set of built-in mock servers that stand in for external services during testing. Each mock is deterministic: given the same input, it returns the same output, so functional tests are reproducible without network access or third-party dependencies.

Mock servers

Subcommand Description
bgp Run BGP functional tests (encoding, plugin, decoding, parsing).
peer BGP test peer with sink, echo, and check modes for session-level testing.
editor Run editor functional tests from .et files (config editing, completion).
ui Run UI functional tests from .ci files (CLI completion, editor features).
web Run web browser functional tests from .wb files.
mcp MCP client that sends commands to the daemon via its MCP endpoint.
managed Run managed config functional tests (hub config, per-client auth, fleet management).
cymru Fake Team Cymru DNS server returning deterministic ASN-to-name TXT records.
irr Fake RPSL whois server for IRR AS-SET expansion and prefix lookups.
peeringdb Fake PeeringDB HTTP server returning deterministic prefix counts derived from ASN.
syslog Syslog receiver that can match a regex pattern and exit on match (for assertions).
text-plugin Minimal external text-mode plugin for .ci test scripts.
rpki Deterministic RPKI RTR cache server (validation state derived from IP prefix modulo).
rtr-mock Lightweight RTR cache server with explicit VRP configuration via --vrp flags and ASPA records via --aspa flags (RTR v2).

Usage

Each subcommand is invoked as ze-test <subcommand> [flags]. Run ze-test <subcommand> --help for the full flag list.

Running functional tests

ze-test bgp encode --all            # Run all encoding tests
ze-test bgp plugin --list           # List available plugin tests
ze-test editor --all                # Run all editor tests
ze-test ui --all                    # Run all UI tests
ze-test web --all                   # Run all web browser tests
ze-test managed --all               # Run all managed config tests

Starting mock servers

ze-test peer --mode sink --port 1179          # BGP sink peer on port 1179
ze-test rpki --port 3323                      # Deterministic RPKI cache
ze-test rtr-mock --port 3323 --vrp 10.0.0.0/8,24,65001   # Explicit VRP mock (RTR v1)
ze-test rtr-mock --port 3323 --vrp 10.0.0.0/8,24,65001 --aspa 64502:64501  # VRP + ASPA (RTR v2)
ze-test cymru --port 5553                     # Team Cymru DNS mock
ze-test irr --port 4343                       # IRR whois mock
ze-test peeringdb --port 8080                 # PeeringDB HTTP mock
ze-test syslog --port 5514 --pattern "ERROR"  # Syslog with pattern match

MCP client

ze-test mcp --port 8080 < commands.txt

Reads Ze commands from stdin (one per line), sends each via MCP ze_execute to the daemon, and prints the responses. Lines starting with # are comments, and wait <duration> pauses between commands.

Testing against other BGP daemons

ze-test mocks stand in for external services, but they do not generate FRR or BIRD configs. Running the same chaos scenario against FRR (bgpd) or BIRD is handled by the ze-chaos orchestrator, which generates the matching daemon config and can fork the daemon directly. See Chaos testing: multi-daemon.

See also

  • Testing for the full test suite overview and Make targets.
  • Chaos testing for the ze-chaos orchestrator and FRR/BIRD multi-daemon runs.

Home

About

First Steps

Configuration

Operation

Interfaces

Plugins

Plugin Development

Chaos Testing

Blueprints

Development

Reference

Clone this wiki locally