Documentation
¶
Overview ¶
Package sintegration simplifies the creation of integration tests.
NOTE: this is a copy of github.com/scionproto/scion/pkg/integration, with some omissions and modifications
Index ¶
- Constants
- func ExtractUniqueDsts(pairs []IAPair) []*snet.UDPAddr
- func GenFile(file string) string
- func GetSCIONDAddress(networksFile string, ia addr.IA) (string, error)
- func GetSCIONDAddresses(networksFile string) (map[string]string, error)
- func Init(projectRoot string) error
- func RunClient(in Integration, pair IAPair, timeout time.Duration) error
- func StartServer(in Integration, dst *snet.UDPAddr) (io.Closer, error)
- type HostAddr
- type IAPair
- type Integration
- type Waiter
Constants ¶
View Source
const ( // StartServerTimeout is the timeout for starting a server. StartServerTimeout = 5 * time.Second // KillServerTimeout is the timeout for waiting for a server to finish KillServerTimeout = 5 * time.Second // SCIONDAddressesFile is the default file for SCIOND addresses in a topology created // with the topology generator. SCIONDAddressesFile = "sciond_addresses.json" )
Variables ¶
This section is empty.
Functions ¶
func ExtractUniqueDsts ¶
ExtractUniqueDsts returns all unique destinations in pairs.
func Init ¶
Init initializes the integration test, it adds and validates the command line flags, and initializes logging.
func RunClient ¶
func RunClient(in Integration, pair IAPair, timeout time.Duration) error
RunClient runs a client on the given IAPair. If the client does not finish until timeout it is killed.
func StartServer ¶ added in v0.5.0
StartServer runs a server. The server can be stopped by calling Close() on the returned Closer. To start a server with a custom context use in.StartServer directly.
Types ¶
type Integration ¶
type Integration interface { // StartServer should start the server listening on the address dst. // StartServer should return after it is ready to accept clients. // The context should be used to make the server cancellable. StartServer(ctx context.Context, dst *snet.UDPAddr) (Waiter, error) // StartClient should start the client on the src address connecting to the dst address. // StartClient should return immediately. // The context should be used to make the client cancellable. StartClient(ctx context.Context, src, dst *snet.UDPAddr) (Waiter, error) }
Integration can be used to run integration tests.
Click to show internal directories.
Click to hide internal directories.