suite

package
v1.15.4 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 54 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) ClearEnvironment

func (cpt *ControlPlaneTest) ClearEnvironment()

ClearEnvironment removes all the test directories.

func (*ControlPlaneTest) DeleteObjects

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

func (*ControlPlaneTest) EnsureWatchers added in v1.13.15

func (cpt *ControlPlaneTest) EnsureWatchers(resources ...string) *ControlPlaneTest

EnsureWatchers delays progress of the test until watchers for resources have been established on the clientset.

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() *ControlPlaneTest

SetupEnvironment sets the fake k8s clients, creates the fake datapath and creates the test directories.

func (*ControlPlaneTest) StartAgent

func (cpt *ControlPlaneTest) StartAgent(modConfig func(*agentOption.DaemonConfig), extraCells ...cell.Cell) *ControlPlaneTest

func (*ControlPlaneTest) StartOperator

func (cpt *ControlPlaneTest) StartOperator(
	modConfig func(*operatorOption.OperatorConfig),
	modCellConfig func(vp *viper.Viper),
) *ControlPlaneTest

func (*ControlPlaneTest) StopAgent

func (cpt *ControlPlaneTest) StopAgent() *ControlPlaneTest

func (*ControlPlaneTest) StopOperator

func (cpt *ControlPlaneTest) StopOperator() *ControlPlaneTest

func (*ControlPlaneTest) UpdateObjects

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

func (*ControlPlaneTest) UpdateObjectsFromFile

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

func (*ControlPlaneTest) WithValidationTimeout

func (cpt *ControlPlaneTest) WithValidationTimeout(d time.Duration) *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