Documentation ¶
Index ¶
- func GatewayAPIConformanceTest(tb testing.TB)
- func IntegrationTest(tb testing.TB)
- func IntegrationTests() bool
- func PrivilegedTest(tb testing.TB)
- func SkipIfFileMissing(t testing.TB, file string)
- func SkipOnOldKernel(tb testing.TB, minVersion, feature string)
- func TempBPFFS(tb testing.TB) string
- func TempCgroup(tb testing.TB) string
- func WaitUntil(condition ConditionFunc, timeout time.Duration) error
- func WaitUntilWithSleep(condition ConditionFunc, timeout, sleep time.Duration) error
- type ConditionFunc
- type TestEndpoint
- func (e *TestEndpoint) ConntrackLocalLocked() bool
- func (e *TestEndpoint) GetCIDRPrefixLengths() ([]int, []int)
- func (e *TestEndpoint) GetID() uint64
- func (e *TestEndpoint) GetIdentity() identity.NumericIdentity
- func (e *TestEndpoint) GetIdentityLocked() identity.NumericIdentity
- func (e *TestEndpoint) GetIfIndex() int
- func (e *TestEndpoint) GetNodeMAC() mac.MAC
- func (e *TestEndpoint) GetOptions() *option.IntOptions
- func (e *TestEndpoint) GetPolicyVerdictLogFilter() uint32
- func (e *TestEndpoint) GetSecurityIdentity() *identity.Identity
- func (e *TestEndpoint) IPv4Address() netip.Addr
- func (e *TestEndpoint) IPv6Address() netip.Addr
- func (e *TestEndpoint) InterfaceName() string
- func (e *TestEndpoint) IsHost() bool
- func (e *TestEndpoint) Logger(subsystem string) *logrus.Entry
- func (e *TestEndpoint) RequireARPPassthrough() bool
- func (e *TestEndpoint) RequireEgressProg() bool
- func (e *TestEndpoint) RequireEndpointRoute() bool
- func (e *TestEndpoint) RequireRouting() bool
- func (e *TestEndpoint) SetIdentity(secID int64, newEndpoint bool)
- func (e *TestEndpoint) StateDir() string
- func (e *TestEndpoint) StringID() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IntegrationTest ¶
IntegrationTest only executes tb if integration tests are requested.
func IntegrationTests ¶
func IntegrationTests() bool
IntegrationTests returns true if integration tests are requested.
func PrivilegedTest ¶
func SkipIfFileMissing ¶
func SkipOnOldKernel ¶
SkipOnOldKernel skips the test if minVersion is lower than the detected kernel version. Parameter feature is mentioned as the reason in the Skip message.
func TempBPFFS ¶
TempBPFFS creates a temporary directory on a BPF FS.
The directory is automatically cleaned up at the end of the test run.
func TempCgroup ¶
TempCgroup finds the first cgroup2 mount point on the host and creates a temporary cgroup in it. Returns the absolute path to the cgroup.
The cgroup is automatically cleaned up at the end of the test run.
func WaitUntil ¶
func WaitUntil(condition ConditionFunc, timeout time.Duration) error
WaitUntil evaluates the condition every 10 milliseconds and waits for the condition to be met. The function will time out and return an error after timeout
func WaitUntilWithSleep ¶
func WaitUntilWithSleep(condition ConditionFunc, timeout, sleep time.Duration) error
WaitUntilWithSleep does the same as WaitUntil except that the sleep time between the condition checks is given.
Types ¶
type ConditionFunc ¶
type ConditionFunc func() bool
ConditionFunc is the function implementing the condition, it must return true if the condition has been met
type TestEndpoint ¶
type TestEndpoint struct { Id uint64 Identity *identity.Identity Opts *option.IntOptions MAC mac.MAC IfIndex int IPv6 netip.Addr // contains filtered or unexported fields }
func NewTestEndpoint ¶
func NewTestEndpoint() TestEndpoint
func NewTestHostEndpoint ¶
func NewTestHostEndpoint() TestEndpoint
func (*TestEndpoint) ConntrackLocalLocked ¶
func (e *TestEndpoint) ConntrackLocalLocked() bool
func (*TestEndpoint) GetCIDRPrefixLengths ¶
func (e *TestEndpoint) GetCIDRPrefixLengths() ([]int, []int)
func (*TestEndpoint) GetID ¶
func (e *TestEndpoint) GetID() uint64
func (*TestEndpoint) GetIdentity ¶
func (e *TestEndpoint) GetIdentity() identity.NumericIdentity
func (*TestEndpoint) GetIdentityLocked ¶
func (e *TestEndpoint) GetIdentityLocked() identity.NumericIdentity
func (*TestEndpoint) GetIfIndex ¶ added in v1.15.7
func (e *TestEndpoint) GetIfIndex() int
func (*TestEndpoint) GetNodeMAC ¶
func (e *TestEndpoint) GetNodeMAC() mac.MAC
func (*TestEndpoint) GetOptions ¶
func (e *TestEndpoint) GetOptions() *option.IntOptions
func (*TestEndpoint) GetPolicyVerdictLogFilter ¶
func (e *TestEndpoint) GetPolicyVerdictLogFilter() uint32
func (*TestEndpoint) GetSecurityIdentity ¶
func (e *TestEndpoint) GetSecurityIdentity() *identity.Identity
func (*TestEndpoint) IPv4Address ¶
func (e *TestEndpoint) IPv4Address() netip.Addr
func (*TestEndpoint) IPv6Address ¶
func (e *TestEndpoint) IPv6Address() netip.Addr
func (*TestEndpoint) InterfaceName ¶
func (e *TestEndpoint) InterfaceName() string
func (*TestEndpoint) IsHost ¶
func (e *TestEndpoint) IsHost() bool
func (*TestEndpoint) RequireARPPassthrough ¶
func (e *TestEndpoint) RequireARPPassthrough() bool
func (*TestEndpoint) RequireEgressProg ¶
func (e *TestEndpoint) RequireEgressProg() bool
func (*TestEndpoint) RequireEndpointRoute ¶
func (e *TestEndpoint) RequireEndpointRoute() bool
func (*TestEndpoint) RequireRouting ¶
func (e *TestEndpoint) RequireRouting() bool
func (*TestEndpoint) SetIdentity ¶
func (e *TestEndpoint) SetIdentity(secID int64, newEndpoint bool)
func (*TestEndpoint) StateDir ¶
func (e *TestEndpoint) StateDir() string
func (*TestEndpoint) StringID ¶
func (e *TestEndpoint) StringID() string