fake

package
v1.16.0-pre.2 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package fake is a fake datapath implementation. It does not implement any datapath specific concepts and is useful for mocking and testing.

Index

Constants

This section is empty.

Variables

View Source
var Cell = cell.Module(
	"fake-datapath",
	"Fake Datapath",

	cell.Provide(
		func(na types.NodeAddressing) (*fakeTypes.FakeDatapath, types.Datapath, types.NodeIDHandler) {
			dp := fakeTypes.NewDatapathWithNodeAddressing(na)
			return dp, dp, dp.NodeIDs()
		},

		func() signalmap.Map { return fakesignalmap.NewFakeSignalMap([][]byte{}, time.Second) },
		func() authmap.Map { return fakeauthmap.NewFakeAuthMap() },
		func() egressmap.PolicyMap { return nil },
		func() *bigtcp.Configuration { return &bigtcp.Configuration{} },
		func() *iptables.Manager { return &iptables.Manager{} },
		func() ipset.Manager { return &fakeTypes.IPSet{} },
		func() types.BandwidthManager { return &fakeTypes.BandwidthManager{} },
		func() types.IPsecKeyCustodian { return &ipsecKeyCustodian{} },
		func() mtu.MTU { return &fakeTypes.MTU{} },
		func() *wg.Agent { return nil },
		func() types.Loader { return &fakeTypes.FakeLoader{} },
		func() sysctl.Sysctl { return &Sysctl{} },

		tables.NewDeviceTable,
		tables.NewL2AnnounceTable, statedb.RWTable[*tables.L2AnnounceEntry].ToTable,
		tables.NewRouteTable, statedb.RWTable[*tables.Route].ToTable,
	),

	tables.NodeAddressCell,
	tables.NodeAddressingCell,

	cell.Invoke(
		statedb.RegisterTable[*tables.Device],
		statedb.RegisterTable[*tables.L2AnnounceEntry],
		statedb.RegisterTable[*tables.Route],
	),

	tunnel.Cell,
	cell.Provide(fakeDevices),
)

Cell provides a fake version of the datapath cell.

Used in integration tests in daemon/cmd and test/controlplane.

Functions

This section is empty.

Types

type Sysctl added in v1.16.0

type Sysctl struct{}

func (*Sysctl) ApplySettings added in v1.16.0

func (sysctl *Sysctl) ApplySettings(sysSettings []tables.Sysctl) error

func (*Sysctl) Disable added in v1.16.0

func (sysctl *Sysctl) Disable(name string) error

func (*Sysctl) Enable added in v1.16.0

func (sysctl *Sysctl) Enable(name string) error

func (*Sysctl) Read added in v1.16.0

func (sysctl *Sysctl) Read(name string) (string, error)

func (*Sysctl) ReadInt added in v1.16.0

func (sysctl *Sysctl) ReadInt(name string) (int64, error)

func (*Sysctl) Write added in v1.16.0

func (sysctl *Sysctl) Write(name string, val string) error

func (*Sysctl) WriteInt added in v1.16.0

func (sysctl *Sysctl) WriteInt(name string, val int64) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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