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 ¶
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
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 ¶
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) 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