Documentation ¶
Index ¶
- type Framework
- func (f *Framework) ClientConfig() *rest.Config
- func (f *Framework) ExpectConsistOf(actual interface{}, extra interface{}, explain ...interface{})
- func (f *Framework) ExpectEmpty(actual interface{}, explain ...interface{})
- func (f *Framework) ExpectEqual(actual interface{}, extra interface{}, explain ...interface{})
- func (f *Framework) ExpectError(err error, explain ...interface{})
- func (f *Framework) ExpectHaveKey(actual interface{}, key interface{}, explain ...interface{})
- func (f *Framework) ExpectNoError(err error, explain ...interface{})
- func (f *Framework) ExpectNoErrorWithOffset(offset int, err error, explain ...interface{})
- func (f *Framework) ExpectNotEqual(actual interface{}, extra interface{}, explain ...interface{})
- func (f *Framework) GetClient() ctrlclient.Client
- func (f *Framework) GetScheme() *runtime.Scheme
- func (f *Framework) GetTimeouts() *TimeoutContext
- type Options
- type TimeoutContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Framework ¶
type Framework struct {
// contains filtered or unexported fields
}
Framework supports common operations used by e2e tests; it will keep a client for you.
func NewDefaultFramework ¶
NewDefaultFramework makes a new framework and sets up clientsets.
func NewFramework ¶
func NewFramework(options Options, client ctrlclient.Client, addToSchemeFuncs ...func(s *runtime.Scheme) error) *Framework
NewFramework creates a test framework.
func NewFrameworkWithCustomTimeouts ¶
func NewFrameworkWithCustomTimeouts(timeouts *TimeoutContext, addToSchemeFuncs ...func(s *runtime.Scheme) error) *Framework
NewFrameworkWithCustomTimeouts makes a framework with with custom timeouts.
func (*Framework) ClientConfig ¶
ClientConfig returns rest configs
func (*Framework) ExpectConsistOf ¶
func (f *Framework) ExpectConsistOf(actual interface{}, extra interface{}, explain ...interface{})
ExpectConsistOf expects actual contains precisely the extra elements. The ordering of the elements does not matter.
func (*Framework) ExpectEmpty ¶
func (f *Framework) ExpectEmpty(actual interface{}, explain ...interface{})
ExpectEmpty expects actual is empty
func (*Framework) ExpectEqual ¶
func (f *Framework) ExpectEqual(actual interface{}, extra interface{}, explain ...interface{})
ExpectEqual expects the specified two are the same, otherwise an exception raises
func (*Framework) ExpectError ¶
ExpectError expects an error happens, otherwise an exception raises
func (*Framework) ExpectHaveKey ¶
func (f *Framework) ExpectHaveKey(actual interface{}, key interface{}, explain ...interface{})
ExpectHaveKey expects the actual map has the key in the keyset
func (*Framework) ExpectNoError ¶
ExpectNoError checks if "err" is set, and if so, fails assertion while logging the error.
func (*Framework) ExpectNoErrorWithOffset ¶
ExpectNoErrorWithOffset checks if "err" is set, and if so, fails assertion while logging the error at "offset" levels above its caller (for example, for call chain f -> g -> ExpectNoErrorWithOffset(1, ...) error would be logged for "f").
func (*Framework) ExpectNotEqual ¶
func (f *Framework) ExpectNotEqual(actual interface{}, extra interface{}, explain ...interface{})
ExpectNotEqual expects the specified two are not the same, otherwise an exception raises
func (*Framework) GetClient ¶
func (f *Framework) GetClient() ctrlclient.Client
GetClient returns controller runtime client
func (*Framework) GetTimeouts ¶
func (f *Framework) GetTimeouts() *TimeoutContext
GetTimeouts returns timeouts
type TimeoutContext ¶
type TimeoutContext struct { // PodStart is how long to wait for the pod to be started. PodStart time.Duration // PodStartShort is same as `PodStart`, but shorter. // Use it in a case-by-case basis, mostly when you are sure pod start will not be delayed. PodStartShort time.Duration // PodStartSlow is same as `PodStart`, but longer. // Use it in a case-by-case basis, mostly when you are sure pod start will take longer than usual. PodStartSlow time.Duration // PodDelete is how long to wait for the pod to be deleted. PodDelete time.Duration // ClaimProvision is how long claims have to become dynamically provisioned. ClaimProvision time.Duration // DataSourceProvision is how long claims have to become dynamically provisioned from source claim. DataSourceProvision time.Duration // ClaimProvisionShort is the same as `ClaimProvision`, but shorter. ClaimProvisionShort time.Duration // ClaimBound is how long claims have to become bound. ClaimBound time.Duration // PVReclaim is how long PVs have to become reclaimed. PVReclaim time.Duration // PVBound is how long PVs have to become bound. PVBound time.Duration // PVCreate is how long PVs have to be created. PVCreate time.Duration // PVDelete is how long PVs have to become deleted. PVDelete time.Duration // PVDeleteSlow is the same as PVDelete, but slower. PVDeleteSlow time.Duration // SnapshotCreate is how long for snapshot to create snapshotContent. SnapshotCreate time.Duration // SnapshotDelete is how long for snapshot to delete snapshotContent. SnapshotDelete time.Duration // SnapshotControllerMetrics is how long to wait for snapshot controller metrics. SnapshotControllerMetrics time.Duration }
TimeoutContext contains timeout settings for several actions.
func NewTimeoutContextWithDefaults ¶
func NewTimeoutContextWithDefaults() *TimeoutContext
NewTimeoutContextWithDefaults returns a TimeoutContext with default values.