libp2p-test-plans/multidim-interop
Marco Munizaga c30c1c429f
Sanitize name before saving to compose file (#164)
2023-04-08 12:31:25 -07:00
..
compose-spec Add fast multidimensional interop tests (#97) 2023-01-10 14:26:27 -08:00
go Add go-libp2p v0.26 (#151) 2023-03-09 16:58:16 -08:00
js Browser WSS testing (#144) 2023-03-06 17:47:40 -08:00
nim Add .gitignore for nim (#145) 2023-02-24 15:09:26 -08:00
rust feat(rust): Add v0.51 (#148) 2023-03-07 07:46:19 -08:00
src Sanitize name before saving to compose file (#164) 2023-04-08 12:31:25 -07:00
.gitignore Add fast multidimensional interop tests (#97) 2023-01-10 14:26:27 -08:00
Makefile Nim interop support (#138) 2023-02-17 09:37:26 -08:00
README.md Add multidim-interop test spec (#117) 2023-01-30 16:26:27 -08:00
dockerBuildWrapper.sh Update Go & JS tests to conform to the multidim interop test spec. (#121) 2023-02-10 17:00:53 -08:00
package-lock.json Support other repos using the multidim interop tests (#99) 2023-01-13 10:23:58 -08:00
package.json Introduce composite action for running ping interop tests (#123) 2023-02-02 10:17:22 +11:00
renderResults.ts Add fast multidimensional interop tests (#97) 2023-01-10 14:26:27 -08:00
testplans.ts Introduce composite action for running ping interop tests (#123) 2023-02-02 10:17:22 +11:00
tsconfig.json Introduce composite action for running ping interop tests (#123) 2023-02-02 10:17:22 +11:00
versions.ts fix(versions): disable webrtc tests (#160) 2023-04-04 13:10:30 +02:00

README.md

Interoperability test

This tests that different libp2p implementations can communicate with each other on each of their supported capabilites.

Each version of libp2p is defined in versions.ts. There the version defines its capabilities along with the id of its container image.

Test spec

The implementation is run in a container and is passed parameters via environment variables. The current parameters are:

Name Description Is Optional
transport The transport to use no
muxer The muxer to use no, except when transport is one of quic, quic-v1, webtransport
security The security channel to use no, except when transport is one of quic, quic-v1, webtransport
is_dialer Should you dial or listen no
ip IP address to bind the listener to yes, default to "0.0.0.0"
redis_addr A different address to connect to redis (default redis:6379) yes, default to the redis host on port 6379
test_timeout_seconds Control the timeout of test. yes, default to 180 seconds.

The test should do two different things depending on if it's the dialer or listener.

Dialer

The dialer should emit all diagnostic logs to stderr. Only the final JSON string result should be emitted to stdout.

  1. Connect to the Redis instance.
  2. Create a libp2p node as defined by the environment variables.
  3. Get the listener's address via Redis' BLPOP using the listenerAddr key.
  4. Record the current instant as handshakeStartInstant.
  5. Connect to the listener.
  6. Ping the listener, and record the round trip duration as pingRTT
  7. Record the duration since handshakeStartInstant. This is handshakePlusOneRTT.
  8. Print to stdout the JSON formatted string: {"handshakePlusOneRTTMillis": handshakePlusOneRTT, "pingRTTMilllis": pingRTT}. Durations should be printed in milliseconds as a float.
  9. Exit with a code zero.

On error, the dialer should return a non-zero exit code.

Listener

The listener should emit all diagnostic logs to stderr.

  1. Connect to the Redis instance.
  2. Create a libp2p node as defined by the environment variables.
  3. Publish the listener's address via Redis' RPUSH using the listenerAddr key.
  4. Sleep for the duration of test_timeout_seconds. The test runner will kill this process when the dialer finishes.
  5. If the timeout is hit, exit with a non-zero error code.

On error, the listener should return a non-zero exit code.