# README
Go Integration Tests
Integration tests in go are standalone binaries that can be run.
The convetion 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.
RunClient runs a client on the given IAPair.
StartServer runs a server.
# Constants
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.
SrcIAReplace is a placeholder for the source IA in the arguments.
# Interfaces
Integration can be used to run integration tests.
Waiter is a descriptor of a process running in the integration test.