package
0.4.0
Repository: https://github.com/joelfischerr/scion.git
Documentation: pkg.go.dev

# README

Go Integration Tests

Integration tests in go are standalone binaries that can be run. The convention is that binaries should end in _integration. We do this by putting the main of integration test in a package named *_integration. After building the integration test binaries end up in ./bin

All integration tests assume the topology is running (scion.sh run)

To run the pingpong integration test do:

./scion.sh build
./scion.sh start
./bin/pp_integration

Implementation of your own integration test

  • An integration test should be a standalone binary, i.e. should have a main method.
  • The binary should be named *_integration.
  • It should exit (os.Exit()) with 0 on success and with a non-zero value on error.
  • The Integration interface and the methods in integration should be used to implement the test.
  • An example can be found in go/examples/pingpong/pp_integration.

# Functions

ExecuteTimed executes f and prints how long f took to StdOut.
ExtractUniqueDsts returns all unique destinations in pairs.
IAPairs returns all IAPairs that should be tested.
Init initializes the integration test, it adds and validates the command line flags, and initializes logging.
NewBinaryIntegration returns an implementation of the Integration interface.
RunBinaryTests runs the client and server for each IAPair.
RunClient runs a client on the given IAPair.
RunUnaryTests runs the client for each IAPair.
StartServer runs a server.
UniqueIAPairs returns all distinct IAPairs that should be tested.
WithTimestamp returns s with the now timestamp prefixed.

# Constants

CtxTimeout is the timeout a context waits before being killed.
DefaultRunTimeout is the timeout when running a server or a client.
DstAddrPattern is a placeholder for the destination address in the arguments.
DstHostReplace is a placeholder for the destination host in the arguments.
DstIAReplace is a placeholder for the destination IA in the arguments.
GoIntegrationEnv is an environment variable that is set for the binary under test.
ReadySignal should be written to Stdout by the server once it is read to accept clients.
RetryTimeout is the timeout between different attempts.
ServerPortReplace is a placeholder for the server port in the arguments.
SrcAddrPattern is a placeholder for the source address in the arguments.
SrcHostReplace is a placeholder for the source host in the arguments.
SrcIAReplace is a placeholder for the source IA in the arguments.
StartServerTimeout is the timeout for starting a server.
WrapperCmd is the command used to run non-test binaries.

# Variables

DispAddr reads the BS host Addr from the topology for the specified IA.
Docker indicates if the tests should be executed in a Docker container.

# Structs

IAPair is a source, destination pair.

# Interfaces

Integration can be used to run integration tests.
Waiter is a descriptor of a process running in the integration test.

# Type aliases

No description provided by the author