Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Multiple Machines

Use machines when a scenario crosses machine boundaries.

test."client reaches server" = { machines, network }: let
  server = machines.node "server";
  client = machines.node "client";
in [
  (machines.configure {
    server.modules = [ serverModule ];
    client.modules = [ clientModule ];
  })

  (expect (server.service "example.service")).toBeActive
  (expect (client.command "example-client server")).toSucceed
]

Each node exposes the machine, terminal, service, filesystem, endpoint, HTTP, user, and container APIs. Nodes also provide lifecycle actions such as start, shutdown, reboot, and crash.

Network Partitions

Use the network fixture to model failures explicitly:

[
  (network.partition { left = [ server ]; right = [ client ]; })
  (expect (network.endpoint {
    from = client;
    host = "server";
    port = 8080;
  })).toBeUnreachable
  (network.heal { left = [ server ]; right = [ client ]; })
]

Use unique host ports when forwarding ports from more than one VM. See Port forwarding.