suite

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FlagUpdate = flag.Bool("update", false, "Update golden test files")
	FlagDebug  = flag.Bool("debug", false, "Enable debug logging")
)

Flags common to controlplane tests.

Functions

func AddTestCase

func AddTestCase(name string, fun func(t *testing.T))

func ParseFlags

func ParseFlags()

func RunSuite

func RunSuite(t *testing.T)

Types

type ControlPlaneTest

type ControlPlaneTest struct {
	Datapath *fakeDatapath.FakeDatapath
	// contains filtered or unexported fields
}

func NewControlPlaneTest

func NewControlPlaneTest(t *testing.T, nodeName string, k8sVersion string) *ControlPlaneTest

func (*ControlPlaneTest) DeleteObjects

func (cpt *ControlPlaneTest) DeleteObjects(objs ...k8sRuntime.Object) *ControlPlaneTest

func (*ControlPlaneTest) Eventually

func (cpt *ControlPlaneTest) Eventually(check func() error) *ControlPlaneTest

func (*ControlPlaneTest) Execute

func (cpt *ControlPlaneTest) Execute(task func() error) *ControlPlaneTest

func (*ControlPlaneTest) Get

Get retrieves a k8s object given its group-version-resource, namespace and name. All the mocked control plane trackers will be queried in the search: - core - slim - cilium The first match will be returned. If the object cannot be found, a non nil error is returned.

func (*ControlPlaneTest) SetupEnvironment

func (cpt *ControlPlaneTest) SetupEnvironment(modConfig func(*agentOption.DaemonConfig, *operatorOption.OperatorConfig)) *ControlPlaneTest

SetupEnvironment sets the fake k8s clients and the mock FQDN proxy required for control-plane testing. Then, it loads the defaults values for both the daemon and the operator configurations. Finally, it calls modConfig to overwrite testcase specific global options values.

func (*ControlPlaneTest) StartAgent

func (cpt *ControlPlaneTest) StartAgent() *ControlPlaneTest

func (*ControlPlaneTest) StartOperator

func (cpt *ControlPlaneTest) StartOperator(modCellConfig func(vp *viper.Viper)) *ControlPlaneTest

func (*ControlPlaneTest) StopAgent

func (cpt *ControlPlaneTest) StopAgent()

func (*ControlPlaneTest) StopOperator

func (cpt *ControlPlaneTest) StopOperator()

func (*ControlPlaneTest) UpdateObjects

func (cpt *ControlPlaneTest) UpdateObjects(objs ...k8sRuntime.Object) *ControlPlaneTest

func (*ControlPlaneTest) UpdateObjectsFromFile

func (cpt *ControlPlaneTest) UpdateObjectsFromFile(filename string) *ControlPlaneTest

type TableBuilder

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

TableBuilder is an utility for formatting data as tables.

func NewEmptyTable

func NewEmptyTable(name string, columnNames ...string) *TableBuilder

func (*TableBuilder) AddRow

func (tw *TableBuilder) AddRow(fields ...string)

func (*TableBuilder) Write

func (tw *TableBuilder) Write(w io.Writer)

Jump to

Keyboard shortcuts

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