e2e

package
v0.0.0-...-9ec6d29 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0, MIT Imports: 11 Imported by: 0

Documentation

Overview

Package e2e contains definitions common to all e2e tcp tests.

Index

Constants

View Source
const (
	// DefaultMTU is the MTU, in bytes, used throughout the tests, except
	// where another value is explicitly used. It is chosen to match the MTU
	// of loopback interfaces on linux systems.
	DefaultMTU = 65535

	// DefaultIPv4MSS is the MSS sent by the network stack in SYN/SYN-ACK for an
	// IPv4 endpoint when the MTU is set to defaultMTU in the test.
	DefaultIPv4MSS = DefaultMTU - header.IPv4MinimumSize - header.TCPMinimumSize

	// TSOptionSize is the size in bytes of the TCP timestamp option.
	TSOptionSize = 12

	// MaxTCPOptionSize is the maximum size TCP Options in a TCP header.
	MaxTCPOptionSize = 40
)

Variables

This section is empty.

Functions

func CheckBrokenUpWrite

func CheckBrokenUpWrite(t *testing.T, c *context.Context, maxPayload int)

CheckBrokenUpWrite does a large write > than the specified maxPayload and verifies that the received packets carry the expected payload and that the large write was broken up into > 1 packet.

func CreateConnectedWithSACKAndTS

func CreateConnectedWithSACKAndTS(c *context.Context) *context.RawEndpoint

CreateConnectedWithSACKAndTS creates and connects c.ep with the SACK & TS option enabled if the stack in the context has SACK and TS enabled.

func CreateConnectedWithSACKPermittedOption

func CreateConnectedWithSACKPermittedOption(c *context.Context) *context.RawEndpoint

CreateConnectedWithSACKPermittedOption creates and connects c.ep with the SACKPermitted option enabled if the stack in the context has the SACK support enabled.

func EnableCUBIC

func EnableCUBIC(t *testing.T, c *context.Context)

EnableCUBIC sets the CUBIC congestion control as the default congestion control algorithm for all newly created endpoints in the context stack.

func SendAndReceiveWithSACK

func SendAndReceiveWithSACK(t *testing.T, c *context.Context, maxPayload int, numPackets int, enableRACK bool) []byte

SendAndReceiveWithSACK creates a SACK enabled connection w/ RACK enabled if enableRACK is true. It then proceeds to write a large payload and verifies that numPackets were received.

func SetStackSACKPermitted

func SetStackSACKPermitted(t *testing.T, c *context.Context, enable bool)

SetStackSACKPermitted sets the tcpip.TCPSACKEnabled option of the context stack to enabled value.

func SetStackTCPRecovery

func SetStackTCPRecovery(t *testing.T, c *context.Context, recovery int)

SetStackTCPRecovery sets the tcpip.TCPRecovery option of the context stack to the specified recovery value.

func TestV4Connect

func TestV4Connect(t *testing.T, c *context.Context, checkers ...checker.NetworkChecker)

TestV4Connect establishes an IPv4 Connection with the context stack.

func TestV6Connect

func TestV6Connect(t *testing.T, c *context.Context, checkers ...checker.NetworkChecker)

TestV6Connect establishes an IPv6 Connection with the context stack.

Types

This section is empty.

Jump to

Keyboard shortcuts

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