Documentation
¶
Index ¶
- func GetControllerMode(controllerMode string) (modeType, modeURL string, err error)
- type EdgeNodeDescription
- type EdgeNodeOption
- type GetEdgeNodeOpts
- type ProcInfoFunc
- type ProcLogFunc
- type ProcMetricFunc
- type ProcTimerFunc
- type Project
- type State
- func (state *State) CheckReady() bool
- func (state *State) GetAinfoSlice() []*info.ZInfoApp
- func (state *State) GetAppMetrics() []*metrics.AppMetric
- func (state *State) GetBinfoSlice() []*info.ZInfoBlob
- func (state *State) GetCinfoSlice() []*info.ZInfoContentTree
- func (state *State) GetDeviceMetrics() *metrics.DeviceMetric
- func (state *State) GetDinfo() *info.ZInfoDevice
- func (state *State) GetInfoProcessingFunction() ProcInfoFunc
- func (state *State) GetMetricProcessingFunction() ProcMetricFunc
- func (state *State) GetNetworkInstanceMetrics() []*metrics.ZMetricNetworkInstance
- func (state *State) GetNiinfoSlice() []*info.ZInfoNetworkInstance
- func (state *State) GetVinfoSlice() []*info.ZInfoVolume
- func (state *State) GetVolumeMetrics() []*metrics.ZMetricVolume
- func (state *State) LookUp(path string) (value reflect.Value, err error)
- type TestContext
- func (tc *TestContext) AddEdgeNodesFromDescription()
- func (tc *TestContext) AddNode(node *device.Ctx)
- func (tc *TestContext) AddProcInfo(edgeNode *device.Ctx, processFunction ProcInfoFunc)
- func (tc *TestContext) AddProcLog(edgeNode *device.Ctx, processFunction ProcLogFunc)
- func (tc *TestContext) AddProcMetric(edgeNode *device.Ctx, processFunction ProcMetricFunc)
- func (tc *TestContext) AddProcTimer(edgeNode *device.Ctx, processFunction ProcTimerFunc)
- func (tc *TestContext) ConfigSync(edgeNode *device.Ctx)
- func (tc *TestContext) ExpandOnSuccess(secs int)
- func (tc *TestContext) FilterByName(name string) GetEdgeNodeOpts
- func (tc *TestContext) GetController() controller.Cloud
- func (tc *TestContext) GetEdgeNode(opts ...GetEdgeNodeOpts) *device.Ctx
- func (tc *TestContext) GetNodeDescriptions() (nodes []*EdgeNodeDescription)
- func (tc *TestContext) GetState(edgeNode *device.Ctx) *State
- func (tc *TestContext) InitProject(name string)
- func (tc *TestContext) NewEdgeNode(opts ...EdgeNodeOption) *device.Ctx
- func (tc *TestContext) StartTrackingState(onlyNewElements bool)
- func (tc *TestContext) UpdateEdgeNode(edgeNode *device.Ctx, opts ...EdgeNodeOption)
- func (tc *TestContext) WaitForProc(secs int)
- func (tc *TestContext) WaitForProcWithErrorCallback(secs int, callback TimeoutCallback)
- func (tc *TestContext) WaitForState(edgeNode *device.Ctx, secs int)
- func (tc *TestContext) WithCurrentProject() EdgeNodeOption
- func (tc *TestContext) WithDeviceModel(devModel string) EdgeNodeOption
- func (tc *TestContext) WithNodeDescription(nodeDescription *EdgeNodeDescription) EdgeNodeOption
- func (tc *TestContext) WithTest(t *testing.T) GetEdgeNodeOpts
- type TimeoutCallback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetControllerMode ¶
GetControllerMode parse url with controller
Types ¶
type EdgeNodeDescription ¶
EdgeNodeDescription must be defined in config file
type EdgeNodeOption ¶
EdgeNodeOption is type to use for creation of device.Ctx
type GetEdgeNodeOpts ¶
GetEdgeNodeOpts pattern to pass device modifications
type ProcInfoFunc ¶
ProcInfoFunc provides callback to process info
type ProcLogFunc ¶
ProcLogFunc provides callback to process log
type ProcMetricFunc ¶
type ProcMetricFunc func(metric *metrics.ZMetricMsg) error
ProcMetricFunc provides callback to process metric
type ProcTimerFunc ¶
type ProcTimerFunc func() error
ProcTimerFunc provides callback to process on timer event
type Project ¶
type Project struct {
// contains filtered or unexported fields
}
Project structure for test set
type State ¶
type State struct {
// contains filtered or unexported fields
}
State aggregates device state
func (*State) CheckReady ¶
CheckReady returns true in all needed information obtained from controller
func (*State) GetAinfoSlice ¶
GetAinfoSlice get []*info.ZInfoApp from obtained info
func (*State) GetAppMetrics ¶
GetAppMetrics get []*metrics.AppMetric from obtained metrics
func (*State) GetBinfoSlice ¶
GetBinfoSlice get []*info.ZInfoBlob from obtained info
func (*State) GetCinfoSlice ¶
func (state *State) GetCinfoSlice() []*info.ZInfoContentTree
GetCinfoSlice get []*info.ZInfoContentTree from obtained info
func (*State) GetDeviceMetrics ¶
func (state *State) GetDeviceMetrics() *metrics.DeviceMetric
GetDeviceMetrics get *metrics.DeviceMetric from obtained metrics
func (*State) GetDinfo ¶
func (state *State) GetDinfo() *info.ZInfoDevice
GetDinfo get *info.ZInfoDevice from obtained info
func (*State) GetInfoProcessingFunction ¶
func (state *State) GetInfoProcessingFunction() ProcInfoFunc
GetInfoProcessingFunction returns processing function for ZInfoMsg
func (*State) GetMetricProcessingFunction ¶
func (state *State) GetMetricProcessingFunction() ProcMetricFunc
GetMetricProcessingFunction returns processing function for ZMetricMsg
func (*State) GetNetworkInstanceMetrics ¶
func (state *State) GetNetworkInstanceMetrics() []*metrics.ZMetricNetworkInstance
GetNetworkInstanceMetrics get []*metrics.ZMetricNetworkInstance from obtained metrics
func (*State) GetNiinfoSlice ¶
func (state *State) GetNiinfoSlice() []*info.ZInfoNetworkInstance
GetNiinfoSlice get []*info.ZInfoNetworkInstance from obtained info
func (*State) GetVinfoSlice ¶
func (state *State) GetVinfoSlice() []*info.ZInfoVolume
GetVinfoSlice get []*info.ZInfoVolume from obtained info
func (*State) GetVolumeMetrics ¶
func (state *State) GetVolumeMetrics() []*metrics.ZMetricVolume
GetVolumeMetrics get []*metrics.ZMetricVolume from obtained metrics
func (*State) LookUp ¶
LookUp access fields of State objects by path path contains address to lookup for example: LookUp("Dinfo.Network[0].IPAddrs[0]") will return first IP of first network of EVE All top fields to lookup in: Dinfo *info.ZInfoDevice Ainfo []*info.ZInfoApp Niinfo []*info.ZInfoNetworkInstance Vinfo []*info.ZInfoVolume Cinfo []*info.ZInfoContentTree Binfo []*info.ZInfoBlob Cipherinfo []*info.ZInfoCipher AppMetrics []*metrics.AppMetric NetworkInstanceMetrics []*metrics.ZMetricNetworkInstance VolumeMetrics []*metrics.ZMetricVolume DeviceMetrics *metrics.DeviceMetric
type TestContext ¶
type TestContext struct {
// contains filtered or unexported fields
}
TestContext is main structure for running tests
func (*TestContext) AddEdgeNodesFromDescription ¶
func (tc *TestContext) AddEdgeNodesFromDescription()
AddEdgeNodesFromDescription adds EdgeNodes from description in test.eve param
func (*TestContext) AddNode ¶
func (tc *TestContext) AddNode(node *device.Ctx)
AddNode add node to test context
func (*TestContext) AddProcInfo ¶
func (tc *TestContext) AddProcInfo(edgeNode *device.Ctx, processFunction ProcInfoFunc)
AddProcInfo add processFunction, that will get all info for edgeNode
func (*TestContext) AddProcLog ¶
func (tc *TestContext) AddProcLog(edgeNode *device.Ctx, processFunction ProcLogFunc)
AddProcLog add processFunction, that will get all logs for edgeNode
func (*TestContext) AddProcMetric ¶
func (tc *TestContext) AddProcMetric(edgeNode *device.Ctx, processFunction ProcMetricFunc)
AddProcMetric add processFunction, that will get all metrics for edgeNode
func (*TestContext) AddProcTimer ¶
func (tc *TestContext) AddProcTimer(edgeNode *device.Ctx, processFunction ProcTimerFunc)
AddProcTimer add processFunction, that will fire with time intervals for edgeNode
func (*TestContext) ConfigSync ¶
func (tc *TestContext) ConfigSync(edgeNode *device.Ctx)
ConfigSync send config to controller
func (*TestContext) ExpandOnSuccess ¶
func (tc *TestContext) ExpandOnSuccess(secs int)
ExpandOnSuccess adds additional time to global timeout on every success check
func (*TestContext) FilterByName ¶
func (tc *TestContext) FilterByName(name string) GetEdgeNodeOpts
FilterByName check EdgeNode name
func (*TestContext) GetController ¶
func (tc *TestContext) GetController() controller.Cloud
GetController returns current controller
func (*TestContext) GetEdgeNode ¶
func (tc *TestContext) GetEdgeNode(opts ...GetEdgeNodeOpts) *device.Ctx
GetEdgeNode return node from context
func (*TestContext) GetNodeDescriptions ¶
func (tc *TestContext) GetNodeDescriptions() (nodes []*EdgeNodeDescription)
GetNodeDescriptions returns list of nodes from config
func (*TestContext) GetState ¶
func (tc *TestContext) GetState(edgeNode *device.Ctx) *State
GetState returns State object for edgeNode
func (*TestContext) InitProject ¶
func (tc *TestContext) InitProject(name string)
InitProject init project object with defined name
func (*TestContext) NewEdgeNode ¶
func (tc *TestContext) NewEdgeNode(opts ...EdgeNodeOption) *device.Ctx
NewEdgeNode creates edge node
func (*TestContext) StartTrackingState ¶
func (tc *TestContext) StartTrackingState(onlyNewElements bool)
StartTrackingState init function for State monitoring if onlyNewElements set no use old information from controller
func (*TestContext) UpdateEdgeNode ¶
func (tc *TestContext) UpdateEdgeNode(edgeNode *device.Ctx, opts ...EdgeNodeOption)
UpdateEdgeNode update edge node
func (*TestContext) WaitForProc ¶
func (tc *TestContext) WaitForProc(secs int)
WaitForProc blocking execution until the time elapses or all Procs gone returns error on timeout
func (*TestContext) WaitForProcWithErrorCallback ¶
func (tc *TestContext) WaitForProcWithErrorCallback(secs int, callback TimeoutCallback)
WaitForProcWithErrorCallback blocking execution until the time elapses or all Procs gone and fires callback in case of timeout
func (*TestContext) WaitForState ¶
func (tc *TestContext) WaitForState(edgeNode *device.Ctx, secs int)
WaitForState wait for State initialization from controller
func (*TestContext) WithCurrentProject ¶
func (tc *TestContext) WithCurrentProject() EdgeNodeOption
WithCurrentProject sets project info
func (*TestContext) WithDeviceModel ¶
func (tc *TestContext) WithDeviceModel(devModel string) EdgeNodeOption
WithDeviceModel sets device model info
func (*TestContext) WithNodeDescription ¶
func (tc *TestContext) WithNodeDescription(nodeDescription *EdgeNodeDescription) EdgeNodeOption
WithNodeDescription sets device info
func (*TestContext) WithTest ¶
func (tc *TestContext) WithTest(t *testing.T) GetEdgeNodeOpts
WithTest assign *testing.T for device
type TimeoutCallback ¶
type TimeoutCallback func()
TimeoutCallback provides callback to process timeout