Documentation ¶
Index ¶
- Variables
- func AddTestCase(name string, fun func(t *testing.T))
- func ParseFlags()
- func RunSuite(t *testing.T)
- type ControlPlaneTest
- func (cpt *ControlPlaneTest) DeleteObjects(objs ...k8sRuntime.Object) *ControlPlaneTest
- func (cpt *ControlPlaneTest) Eventually(check func() error) *ControlPlaneTest
- func (cpt *ControlPlaneTest) Execute(task func() error) *ControlPlaneTest
- func (cpt *ControlPlaneTest) Get(gvr schema.GroupVersionResource, ns, name string) (k8sRuntime.Object, error)
- func (cpt *ControlPlaneTest) SetupEnvironment(modConfig func(*agentOption.DaemonConfig, *operatorOption.OperatorConfig)) *ControlPlaneTest
- func (cpt *ControlPlaneTest) StartAgent() *ControlPlaneTest
- func (cpt *ControlPlaneTest) StartOperator(modCellConfig func(vp *viper.Viper)) *ControlPlaneTest
- func (cpt *ControlPlaneTest) StopAgent()
- func (cpt *ControlPlaneTest) StopOperator()
- func (cpt *ControlPlaneTest) UpdateObjects(objs ...k8sRuntime.Object) *ControlPlaneTest
- func (cpt *ControlPlaneTest) UpdateObjectsFromFile(filename string) *ControlPlaneTest
- type TableBuilder
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 ParseFlags ¶
func ParseFlags()
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 ¶
func (cpt *ControlPlaneTest) Get(gvr schema.GroupVersionResource, ns, name string) (k8sRuntime.Object, error)
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)
Click to show internal directories.
Click to hide internal directories.