Files
firezone/rust/connection-tests
Thomas Eizinger 85304329b9 fix(connection-tests): avoid rare flakiness of relay test (#3394)
This was a bug in my test harness, not `firezone-connection`:

For the relay test to succeed, we need to communicate all candidates
between the partys. I noticed that in the tests that failed, one side
did not receive all the candidates. In particular, the `relay` candidate
was sometimes missing which makes it impossible for the two clients to
communicate.

The candidates are communicated over redis and the events from redis are
retrieved together with polling of the event-loop. `tokio::select!`
polls those futures simultaneously but **drops** the other one when one
becomes ready. If that future is "half-way" through receiving a
candidate from the redis DB, it will be lost.

To mitigate this, we now use an `mpsc::channel` between the `Eventloop`
and a separately spawned task that can read from redis without being
interrupted.
2024-01-25 15:57:54 +00:00
..

firezone-connection integration tests

This directory contains Docker-based integration tests for the firezone-connection crate. Each integration test setup is a dedicated docker-compose file.

Running

To run one of these tests, use the following command:

sudo docker compose -f ./docker-compose.lan.yml up --exit-code-from dialer --abort-on-container-exit --build

This will force a re-build of the containers and exit with 0 if everything works correctly.

Design

Each file consists of at least:

  • A dialer
  • A listener
  • A redis server

Redis acts as the signalling channel. Dialer and listener use it to exchange offers & answers as well as ICE candidates.

The various files simulate different network environments. We use nftables to simulate NATs and / or force the use of TURN servers.