# 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
).
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.
# Functions
ExecuteTimed executes f and prints how long f took to StdOut.
ExtractUniqueDsts returns all unique destinations in pairs.
GenFile returns the path for the given file in the gen folder.
No description provided by the author
No description provided by the author
GroupBySource groups the ISD-AS pairs by source.
IAPairs returns all IAPairs that should be tested.
Init initializes the integration test, it adds and validates the command line flags, and initializes logging.
ListenDone opens a RPC server to listen for done signals.
LoadASList parses the yaml file fileName and returns a structure with non-core and core ASes.
No description provided by the author
LogDir returns the path for logs.
NewBinaryIntegration returns an implementation of the Integration interface.
Run runs the commands of the run config.
RunClient runs a client on the given IAPair.
RunUnaryTests runs the client for each IAPair.
StartServer runs a server.
TesterID returns the ID of the tester container.
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.
Daemon is a placeholder for the Daemon server in the arguments.
DaemonAddressesFile is the default file for SCIOND addresses in a topology created with the topology generator.
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
CSAddr reads the tester host Addr from the topology for the specified IA.
Docker indicates if the tests should be executed in a Docker container.
LoadedASList exposes the ASList loaded during Init.
# Structs
ASList is a list of ISD-AS identifiers grouped by core and non-core.
BinaryWaiter can be used to wait on completion of the process.
Cmd represents a single command.
IAPair is a source, destination pair.
RunConfig is used to configure the run.
# 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