itest

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2017 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package itest contains automated tests that integrate multiple plugins and mocks external systems (ETCD...)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockHTTP

func MockHTTP() *httpmock.HTTPMock

MockHTTP returns new instance of HTTP mock (usefull to avoid import aliases in other files)

func StartEmbeddedETCD

func StartEmbeddedETCD(t *testing.T, flavorLocal *local.FlavorLocal) (*etcdv3.Plugin, *etcdmock.Embedded)

StartEmbeddedETCD initializes embedded ETCD & returns plugin instance for accessing it

Types

type AgentTestHelper

type AgentTestHelper struct {
	// contains filtered or unexported fields
}

AgentTestHelper is similar to what testing.T is in golang packages.

func (*AgentTestHelper) DefaultSetup

func (t *AgentTestHelper) DefaultSetup(golangT *testing.T)

DefaultSetup initializes the SFC Controller with embedded ETCD

func (*AgentTestHelper) Teardown

func (t *AgentTestHelper) Teardown()

Teardown stops the sfcAgent

type Flavor

type Flavor struct {
	*local.FlavorLocal
	HTTP      rest.Plugin
	HealthRPC probe.Plugin
	LogMngRPC logmanager.Plugin
	ETCD      etcdv3.Plugin

	Sfc       sfccore.SfcControllerPluginHandler
	VNFDriver vnfdriver.Plugin
	// contains filtered or unexported fields
}

Flavor is set of common used generic plugins. This flavour can be used as a base for different flavours. The plugins are initialized in the same order as they appear in the structure.

func (*Flavor) Inject

func (f *Flavor) Inject() bool

Inject interconnects plugins - injects the dependencies. If it has been called already it is no op.

func (*Flavor) Plugins

func (f *Flavor) Plugins() []*agent_api.NamedPlugin

Plugins returns all plugins from the flavour. The set of plugins is supposed to be passed to the sfcAgent constructor. The method calls inject to make sure that dependencies have been injected.

type Given

type Given struct {
	// contains filtered or unexported fields
}

Given is composition of multiple test step methods (see BDD Given keyword)

func (*Given) ConfigSFCviaETCD

func (t *Given) ConfigSFCviaETCD(cfg *sfccore.YamlConfig)

ConfigSFCviaETCD puts SFC config to keyvalue store (e.g. ETCD)

func (*Given) ConfigSFCviaREST

func (t *Given) ConfigSFCviaREST(cfg *sfccore.YamlConfig)

ConfigSFCviaREST posts SFC config via REST

func (*Given) EmptyETCD

func (t *Given) EmptyETCD()

EmptyETCD deletes all keys in ETCD

func (*Given) StartAgent

func (t *Given) StartAgent()

StartAgent in test (if there is error than panic => fail test)

type TestingConFlavor

type TestingConFlavor struct {
	*local.FlavorLocal
	ETCD etcdv3.Plugin
	// contains filtered or unexported fields
}

TestingConFlavor - just ETCD connectivity

func (*TestingConFlavor) Inject

func (f *TestingConFlavor) Inject() bool

Inject interconnects plugins - injects the dependencies. If it has been called already it is no op.

func (*TestingConFlavor) Plugins

func (f *TestingConFlavor) Plugins() []*agent_api.NamedPlugin

Plugins returns all plugins from the flavour. The set of plugins is supposed to be passed to the sfcAgent constructor. The method calls inject to make sure that dependencies have been injected.

type Then

type Then struct {
	// contains filtered or unexported fields
}

Then is composition of multiple test step methods (see BDD Then keyword)

func (*Then) HTTPGetEntities

func (t *Then) HTTPGetEntities(sfcCfg *sfccore.YamlConfig)

HTTPGet simulates the HTTP call

func (*Then) VppAgentCfgContains

func (t *Then) VppAgentCfgContains(micorserviceLabel string, interfaceBDEtc ...proto.Message)

VppAgentcCfgContains

type When

type When struct {
}

When is composition of multiple test step methods (see BDD When keyword)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL