Documentation ¶
Index ¶
- Variables
- func NewTestPodLister(pods []*kapiv1.Pod) kv1.PodLister
- func NewTestPodNamespaceLister(pods []*kapiv1.Pod, namespace string) kv1.PodNamespaceLister
- func PodGen(name, namespace string, labels, annotations map[string]string, ...) *kapiv1.Pod
- func ValidateTestSequence(wg *sync.WaitGroup, t *testing.T, duration time.Duration, sequenceTitle string, ...)
- type TestPodControl
- func (t *TestPodControl) InitBreakerAnnotationAndLabel(name string, p *kapiv1.Pod) (*kapiv1.Pod, error)
- func (t *TestPodControl) KillPod(name string, p *kapiv1.Pod) error
- func (t *TestPodControl) RemoveBreakerAnnotationAndLabel(p *kapiv1.Pod) (*kapiv1.Pod, error)
- func (t *TestPodControl) UpdateActivationLabelsAndAnnotations(name string, p *kapiv1.Pod) (*kapiv1.Pod, error)
- func (t *TestPodControl) UpdateBreakerAnnotationAndLabel(name string, strategy string, p *kapiv1.Pod) (*kapiv1.Pod, error)
- func (t *TestPodControl) UpdatePauseLabelsAndAnnotations(name string, p *kapiv1.Pod) (*kapiv1.Pod, error)
- type TestStepSequence
- func (es *TestStepSequence) Completed() bool
- func (es *TestStepSequence) Len() int
- func (es *TestStepSequence) PassAtLeastOnce(step int)
- func (es *TestStepSequence) PassOnlyOnce(step int)
- func (es *TestStepSequence) ValidateTestSequence(wg *sync.WaitGroup)
- func (es *TestStepSequence) ValidateTestSequenceNoOrder(wg *sync.WaitGroup)
Constants ¶
This section is empty.
Variables ¶
var MapOfSequences = map[string]*TestStepSequence{}
MapOfSequences represent a TestStepSequence map
Functions ¶
func NewTestPodLister ¶
NewTestPodLister create a new PodLister. FOR TEST PURPOSE ONLY
func NewTestPodNamespaceLister ¶
func NewTestPodNamespaceLister(pods []*kapiv1.Pod, namespace string) kv1.PodNamespaceLister
NewTestPodNamespaceLister create a new PodNamespaceLister. FOR TEST PURPOSE ONLY
Types ¶
type TestPodControl ¶
type TestPodControl struct { T *testing.T Case string FailOnUndefinedFunc bool InitBreakerAnnotationAndLabelFunc func(name string, p *kapiv1.Pod) (*kapiv1.Pod, error) UpdateBreakerAnnotationAndLabelFunc func(name string, strategy string, p *kapiv1.Pod) (*kapiv1.Pod, error) UpdateActivationLabelsAndAnnotationsFunc func(name string, p *kapiv1.Pod) (*kapiv1.Pod, error) UpdatePauseLabelsAndAnnotationsFunc func(name string, p *kapiv1.Pod) (*kapiv1.Pod, error) RemoveBreakerAnnotationAndLabelFunc func(p *kapiv1.Pod) (*kapiv1.Pod, error) KillPodFunc func(name string, p *kapiv1.Pod) error }
TestPodControl test mock for podcontro
func (*TestPodControl) InitBreakerAnnotationAndLabel ¶
func (t *TestPodControl) InitBreakerAnnotationAndLabel(name string, p *kapiv1.Pod) (*kapiv1.Pod, error)
InitBreakerAnnotationAndLabel fake implementation for podcontrol
func (*TestPodControl) KillPod ¶
func (t *TestPodControl) KillPod(name string, p *kapiv1.Pod) error
KillPod fake implementation for podcontrol
func (*TestPodControl) RemoveBreakerAnnotationAndLabel ¶
RemoveBreakerAnnotationAndLabel fake implementatin for podcontrol
func (*TestPodControl) UpdateActivationLabelsAndAnnotations ¶
func (t *TestPodControl) UpdateActivationLabelsAndAnnotations(name string, p *kapiv1.Pod) (*kapiv1.Pod, error)
UpdateActivationLabelsAndAnnotations fake implementation for podcontrol
func (*TestPodControl) UpdateBreakerAnnotationAndLabel ¶
func (t *TestPodControl) UpdateBreakerAnnotationAndLabel(name string, strategy string, p *kapiv1.Pod) (*kapiv1.Pod, error)
UpdateBreakerAnnotationAndLabel fake implementation for podcontrol
func (*TestPodControl) UpdatePauseLabelsAndAnnotations ¶
func (t *TestPodControl) UpdatePauseLabelsAndAnnotations(name string, p *kapiv1.Pod) (*kapiv1.Pod, error)
UpdatePauseLabelsAndAnnotations fake implementation for podcontrol
type TestStepSequence ¶
type TestStepSequence struct {
// contains filtered or unexported fields
}
TestStepSequence sequence of test steps
func GetTestSequence ¶
func GetTestSequence(t *testing.T, registrationName string) *TestStepSequence
GetTestSequence retrieve test sequence Should be called
func NewTestSequence ¶
func NewTestSequence(t *testing.T, registrationName string, count int, duration time.Duration) *TestStepSequence
NewTestSequence Create a test sequence
func (*TestStepSequence) Completed ¶
func (es *TestStepSequence) Completed() bool
Completed check that all step of the sequence have been completed.
func (*TestStepSequence) Len ¶
func (es *TestStepSequence) Len() int
Len return the number of steps in the sequence
func (*TestStepSequence) PassAtLeastOnce ¶
func (es *TestStepSequence) PassAtLeastOnce(step int)
PassAtLeastOnce to be called when a step in the sequence is considered as passed qnd can't be passed a second time
func (*TestStepSequence) PassOnlyOnce ¶
func (es *TestStepSequence) PassOnlyOnce(step int)
PassOnlyOnce to be called when a step in the sequence is considered as passed and can't be passed a second time else (t.Fatal)
func (*TestStepSequence) ValidateTestSequence ¶
func (es *TestStepSequence) ValidateTestSequence(wg *sync.WaitGroup)
ValidateTestSequence validate that the sequence is completed in order in the given time
func (*TestStepSequence) ValidateTestSequenceNoOrder ¶
func (es *TestStepSequence) ValidateTestSequenceNoOrder(wg *sync.WaitGroup)
ValidateTestSequenceNoOrder validate that the sequence is completed in order in the given time