libovsdb

package
v0.0.0-...-bdf4f4e Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConsistOfIgnoringUUIDs

func ConsistOfIgnoringUUIDs(expected ...TestData) gomegatypes.GomegaMatcher

func CreateTransitSwitchPortBindings

func CreateTransitSwitchPortBindings(sbClient libovsdbclient.Client, datapath string, names ...string) error

func HaveData

func HaveData(expected ...TestData) gomegatypes.GomegaMatcher

HaveData matches expected libovsdb models with named UUIDs

func HaveDataExact

func HaveDataExact(expected ...TestData) gomegatypes.GomegaMatcher

HaveDataExact matches expected libovsdb models exactly

func HaveDataIgnoringUUIDs

func HaveDataIgnoringUUIDs(expected ...TestData) gomegatypes.GomegaMatcher

HaveDataIgnoringUUIDs matches expected libovsdb models ignoring UUIDs

func HaveEmptyData

func HaveEmptyData() gomegatypes.GomegaMatcher

Types

type Context

type Context struct {
	SBServer  *TestOvsdbServer
	NBServer  *TestOvsdbServer
	OVSServer *TestOvsdbServer
	// contains filtered or unexported fields
}

func NewNBSBTestHarness

func NewNBSBTestHarness(setup TestSetup) (libovsdbclient.Client, libovsdbclient.Client, *Context, error)

NewNBSBTestHarness runs NB & SB OVSDB servers and returns corresponding clients

func NewNBTestHarness

func NewNBTestHarness(setup TestSetup, testCtx *Context) (libovsdbclient.Client, *Context, error)

NewNBTestHarness runs NB server and returns corresponding client

func NewOVSTestHarness

func NewOVSTestHarness(setup TestSetup) (libovsdbclient.Client, *Context, error)

NewOVSTestHarness runs OVSDB server and returns corresponding client

func NewSBTestHarness

func NewSBTestHarness(setup TestSetup, testCtx *Context) (libovsdbclient.Client, *Context, error)

NewSBTestHarness runs SB server and returns corresponding client

func (*Context) Cleanup

func (c *Context) Cleanup()

type TestData

type TestData interface{}

type TestOvsdbServer

type TestOvsdbServer struct {
	*server.OvsdbServer
	// contains filtered or unexported fields
}

func (*TestOvsdbServer) CreateTestData

func (t *TestOvsdbServer) CreateTestData(data []TestData) error

CreateTestData inserts test data into the database after the server is started. We must use the server's Transact() method to ensure updates are sent to clients that may have already been created.

type TestSetup

type TestSetup struct {
	// IgnoreConstraints, when true, ignores constraints validation errors
	// when adding data to the database, allowing a testcase to force
	// addition of invalid data (like duplicate indexes).
	IgnoreConstraints bool

	NBData  []TestData
	SBData  []TestData
	OVSData []TestData
}

Jump to

Keyboard shortcuts

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