commonTestUtils

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name           = "kubevirt-hyperconverged"
	Namespace      = "kubevirt-hyperconverged"
	VirtioWinImage = "quay.io/kubevirt/virtio-container-disk:v2.0.0"
)

Name and Namespace of our primary resource

Variables

View Source
var (
	TestLogger  = zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)).WithName("controller_hyperconverged")
	TestRequest = reconcile.Request{
		NamespacedName: types.NamespacedName{
			Name:      Name,
			Namespace: Namespace,
		},
	}
)

Functions

func CopyFile added in v1.5.0

func CopyFile(dest, src string) error

func GetScheme

func GetScheme() *runtime.Scheme

func NewHco

func NewHco() *hcov1beta1.HyperConverged

func NewHcoNamespace added in v1.6.0

func NewHcoNamespace() *corev1.Namespace

func NewNodePlacement

func NewNodePlacement() *sdkapi.NodePlacement

func NewOtherNodePlacement

func NewOtherNodePlacement() *sdkapi.NodePlacement

func NewReq

func RepresentCondition added in v1.5.0

func RepresentCondition(expected metav1.Condition) gomegatypes.GomegaMatcher

RepresentCondition - returns a GomegaMatcher useful for comparing conditions

Types

type ClusterInfoMock added in v1.6.0

type ClusterInfoMock struct{}

ClusterInfoMock mocks regular Openshift

func (ClusterInfoMock) GetDomain added in v1.6.0

func (ClusterInfoMock) GetDomain() string

func (ClusterInfoMock) Init added in v1.6.0

func (ClusterInfoMock) IsControlPlaneHighlyAvailable added in v1.6.0

func (ClusterInfoMock) IsControlPlaneHighlyAvailable() bool

func (ClusterInfoMock) IsInfrastructureHighlyAvailable added in v1.6.0

func (ClusterInfoMock) IsInfrastructureHighlyAvailable() bool

func (ClusterInfoMock) IsManagedByOLM added in v1.6.0

func (ClusterInfoMock) IsManagedByOLM() bool

func (ClusterInfoMock) IsOpenshift added in v1.6.0

func (ClusterInfoMock) IsOpenshift() bool

func (ClusterInfoMock) IsRunningLocally added in v1.6.0

func (ClusterInfoMock) IsRunningLocally() bool

type ClusterInfoSNOMock added in v1.6.0

type ClusterInfoSNOMock struct{}

ClusterInfoSNOMock mocks Openshift SNO

func (ClusterInfoSNOMock) GetDomain added in v1.6.0

func (ClusterInfoSNOMock) GetDomain() string

func (ClusterInfoSNOMock) Init added in v1.6.0

func (ClusterInfoSNOMock) IsControlPlaneHighlyAvailable added in v1.6.0

func (ClusterInfoSNOMock) IsControlPlaneHighlyAvailable() bool

func (ClusterInfoSNOMock) IsInfrastructureHighlyAvailable added in v1.6.0

func (ClusterInfoSNOMock) IsInfrastructureHighlyAvailable() bool

func (ClusterInfoSNOMock) IsManagedByOLM added in v1.6.0

func (ClusterInfoSNOMock) IsManagedByOLM() bool

func (ClusterInfoSNOMock) IsOpenshift added in v1.6.0

func (ClusterInfoSNOMock) IsOpenshift() bool

func (ClusterInfoSNOMock) IsRunningLocally added in v1.6.0

func (ClusterInfoSNOMock) IsRunningLocally() bool

type ClusterInfoSRCPHAIMock added in v1.6.0

type ClusterInfoSRCPHAIMock struct{}

ClusterInfoSRCPHAIMock mocks Openshift with SingleReplica ControlPlane and HighAvailable Infrastructure

func (ClusterInfoSRCPHAIMock) GetDomain added in v1.6.0

func (ClusterInfoSRCPHAIMock) GetDomain() string

func (ClusterInfoSRCPHAIMock) Init added in v1.6.0

func (ClusterInfoSRCPHAIMock) IsControlPlaneHighlyAvailable added in v1.6.0

func (ClusterInfoSRCPHAIMock) IsControlPlaneHighlyAvailable() bool

func (ClusterInfoSRCPHAIMock) IsInfrastructureHighlyAvailable added in v1.6.0

func (ClusterInfoSRCPHAIMock) IsInfrastructureHighlyAvailable() bool

func (ClusterInfoSRCPHAIMock) IsManagedByOLM added in v1.6.0

func (ClusterInfoSRCPHAIMock) IsManagedByOLM() bool

func (ClusterInfoSRCPHAIMock) IsOpenshift added in v1.6.0

func (ClusterInfoSRCPHAIMock) IsOpenshift() bool

func (ClusterInfoSRCPHAIMock) IsRunningLocally added in v1.6.0

func (ClusterInfoSRCPHAIMock) IsRunningLocally() bool

type EventEmitterMock

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

func NewEventEmitterMock added in v1.4.0

func NewEventEmitterMock() *EventEmitterMock

func (EventEmitterMock) CheckEvents added in v1.4.0

func (eem EventEmitterMock) CheckEvents(expectedEvents []MockEvent) bool

func (*EventEmitterMock) EmitEvent

func (eem *EventEmitterMock) EmitEvent(_ runtime.Object, eventType, reason, msg string)

func (EventEmitterMock) Init

func (*EventEmitterMock) Reset added in v1.4.0

func (eem *EventEmitterMock) Reset()

func (EventEmitterMock) UpdateClient

func (EventEmitterMock) UpdateClient(_ context.Context, _ client.Reader, _ logr.Logger)

type FakeReadErrorGenerator added in v1.4.0

type FakeReadErrorGenerator func(key client.ObjectKey) error

type FakeWriteErrorGenerator added in v1.4.0

type FakeWriteErrorGenerator func(obj client.Object) error

type HcoTestClient

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

implements the client.Client interface (proxy pattern)

func InitClient

func InitClient(clientObjects []runtime.Object) *HcoTestClient

func (*HcoTestClient) Create

func (c *HcoTestClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error

func (*HcoTestClient) Delete

func (c *HcoTestClient) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error

func (*HcoTestClient) DeleteAllOf

func (c *HcoTestClient) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error

func (*HcoTestClient) Get

func (*HcoTestClient) InitiateCreateErrors added in v1.4.0

func (c *HcoTestClient) InitiateCreateErrors(f FakeWriteErrorGenerator)

func (*HcoTestClient) InitiateDeleteErrors added in v1.4.0

func (c *HcoTestClient) InitiateDeleteErrors(f FakeWriteErrorGenerator)

func (*HcoTestClient) InitiateGetErrors added in v1.4.0

func (c *HcoTestClient) InitiateGetErrors(f FakeReadErrorGenerator)

func (*HcoTestClient) InitiateUpdateErrors added in v1.4.0

func (c *HcoTestClient) InitiateUpdateErrors(f FakeWriteErrorGenerator)

func (*HcoTestClient) List

func (c *HcoTestClient) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error

func (*HcoTestClient) Patch

func (c *HcoTestClient) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error

func (*HcoTestClient) RESTMapper added in v1.4.0

func (c *HcoTestClient) RESTMapper() meta.RESTMapper

func (*HcoTestClient) Scheme added in v1.4.0

func (c *HcoTestClient) Scheme() *runtime.Scheme

func (*HcoTestClient) Status

func (c *HcoTestClient) Status() client.StatusWriter

func (*HcoTestClient) Update

func (c *HcoTestClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error

type HcoTestStatusWriter

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

func (*HcoTestStatusWriter) InitiateErrors

func (sw *HcoTestStatusWriter) InitiateErrors(errs ...error)

func (*HcoTestStatusWriter) Patch

func (sw *HcoTestStatusWriter) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error

func (*HcoTestStatusWriter) Update

func (sw *HcoTestStatusWriter) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error

type MockEvent added in v1.4.0

type MockEvent struct {
	EventType string
	Reason    string
	Msg       string
}

type RepresentConditionMatcher added in v1.5.0

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

func (*RepresentConditionMatcher) FailureMessage added in v1.5.0

func (matcher *RepresentConditionMatcher) FailureMessage(actual interface{}) (message string)

func (*RepresentConditionMatcher) Match added in v1.5.0

func (matcher *RepresentConditionMatcher) Match(actual interface{}) (success bool, err error)

Match - compares two conditions two conditions are the same if they have the same type, status, reason, and message

func (*RepresentConditionMatcher) NegatedFailureMessage added in v1.5.0

func (matcher *RepresentConditionMatcher) NegatedFailureMessage(actual interface{}) (message string)

type TestErrors

type TestErrors []error

func (*TestErrors) GetNextError

func (errs *TestErrors) GetNextError() (bool, error)

Jump to

Keyboard shortcuts

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