framework

package
v0.0.0-...-d15df5a Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TEIDPGWs5u          = 1000000000
	TEIDSGWs5u          = 1000000001
	ProxyAccessTEID     = 1000000002
	ProxyCoreTEID       = 1000000003
	KeepAllArtifactsEnv = "E2E_KEEP_ALL_ARTIFACTS"
)
View Source
const (
	HTTPAppName = "TST"
	IPAppName   = "IPAPP"
)
View Source
const (
	BBF_EID                 = 3561
	TP_EID                  = 18681
	ETYPE_MASK              = 0x8000
	BBF_TYPE_APPLY_ACTION   = 15
	BBF_TYPE_NAT_PORT_BLOCK = 18
	BBF_APPLY_ACTION_NAT    = 1
	TP_IPFIX_TEMPLATE       = 11
)

From IANA Private Enterprise Numbers Registry, Broadband Forum Enterprise ID is 3561 (0x0DE9) Enterprise Specific IE Types are marked with 0x8000 mask

Variables

This section is empty.

Functions

func DefaultPFCPConfig

func DefaultPFCPConfig(vppCfg vpp.VPPConfig) pfcp.PFCPConfig

func EncodeAPN

func EncodeAPN(s string) string

func ExpectConsistOf

func ExpectConsistOf(actual interface{}, extra interface{}, explain ...interface{})

ExpectConsistOf expects actual contains precisely the extra elements. The ordering of the elements does not matter.

func ExpectEmpty

func ExpectEmpty(actual interface{}, explain ...interface{})

ExpectEmpty expects actual is empty

func ExpectEqual

func ExpectEqual(actual interface{}, extra interface{}, explain ...interface{})

ExpectEqual expects the specified two are the same, otherwise an exception raises

func ExpectError

func ExpectError(err error, explain ...interface{})

ExpectError expects an error happens, otherwise an exception raises

func ExpectHaveKey

func ExpectHaveKey(actual interface{}, key interface{}, explain ...interface{})

ExpectHaveKey expects the actual map has the key in the keyset

func ExpectNoError

func ExpectNoError(err error, explain ...interface{})

ExpectNoError checks if "err" is set, and if so, fails assertion while logging the error.

func ExpectNoErrorWithOffset

func ExpectNoErrorWithOffset(offset int, err error, explain ...interface{})

ExpectNoErrorWithOffset checks if "err" is set, and if so, fails assertion while logging the error at "offset" levels above its caller (for example, for call chain f -> g -> ExpectNoErrorWithOffset(1, ...) error would be logged for "f").

func ExpectNotEqual

func ExpectNotEqual(actual interface{}, extra interface{}, explain ...interface{})

ExpectNotEqual expects the specified two are not the same, otherwise an exception raises

func Logf

func Logf(format string, args ...interface{})

Logf logs the info.

func MustParseIP

func MustParseIP(s string) net.IP

func MustParseIPNet

func MustParseIPNet(s string) *net.IPNet

func MustParseMAC

func MustParseMAC(s string) net.HardwareAddr

func RunningInLinuxkit

func RunningInLinuxkit() bool

func SetArtifactsDirectory

func SetArtifactsDirectory(dir string)

Types

type Framework

type Framework struct {
	Mode     UPGMode
	IPMode   UPGIPMode
	VPPCfg   *vpp.VPPConfig
	VPP      *vpp.VPPInstance
	PFCPCfg  *pfcp.PFCPConfig
	PFCP     *pfcp.PFCPConnection
	GTPUs    []*GTPU
	Context  context.Context
	GTPUMTU  int
	TPDUHook TPDUHook

	FITHook *util.FITHook
	// contains filtered or unexported fields
}

func NewDefaultFramework

func NewDefaultFramework(mode UPGMode, ipMode UPGIPMode) *Framework

func NewDefaultFrameworkFIT

func NewDefaultFrameworkFIT(mode UPGMode, ipMode UPGIPMode, fitHook *util.FITHook) *Framework

func NewFramework

func NewFramework(mode UPGMode, ipMode UPGIPMode, vppCfg *vpp.VPPConfig, pfcpCfg *pfcp.PFCPConfig) *Framework

func NewFrameworkFIT

func NewFrameworkFIT(mode UPGMode, ipMode UPGIPMode, vppCfg *vpp.VPPConfig, pfcpCfg *pfcp.PFCPConfig, fitHook *util.FITHook) *Framework

func (*Framework) AddCNodeIP

func (f *Framework) AddCNodeIP() net.IP

func (*Framework) AddCustomServerIP

func (f *Framework) AddCustomServerIP(ipNet *net.IPNet)

func (*Framework) AddServerIP

func (f *Framework) AddServerIP() net.IP

func (*Framework) AddUEIP

func (f *Framework) AddUEIP() net.IP

func (*Framework) AfterEach

func (f *Framework) AfterEach()

func (*Framework) BeforeEach

func (f *Framework) BeforeEach()

func (*Framework) Ping

func (f *Framework) Ping(nsName string, ip net.IP, count int)

func (*Framework) ServerIP

func (f *Framework) ServerIP() net.IP

func (*Framework) ServerNSName

func (f *Framework) ServerNSName() string

func (*Framework) SlowGTPU

func (f *Framework) SlowGTPU() bool

SlowGTPU returns true if UPG runs in PGW mode, and userspace GTP-U tunneling is being used, which may be not fast enough, causing some packet drops on GRX<->UE path. In this case, only GRX pcaps should be used to validate traffic measurements

func (*Framework) UEIP

func (f *Framework) UEIP() net.IP

type GTPU

type GTPU struct {
	// contains filtered or unexported fields
}

func NewGTPU

func NewGTPU(cfg GTPUConfig) (*GTPU, error)

func (*GTPU) Context

func (gtpu *GTPU) Context(parent context.Context) context.Context

func (*GTPU) Start

func (gtpu *GTPU) Start(ctx context.Context) error

func (*GTPU) Stop

func (gtpu *GTPU) Stop() error

type GTPUConfig

type GTPUConfig struct {
	GRXNS      *network.NetNS
	UENS       *network.NetNS
	UEIP       net.IP
	SGWIP      net.IP
	PGWIP      net.IP
	TEIDPGWs5u uint32
	TEIDSGWs5u uint32
	LinkName   string
	MTU        int
	TPDUHook   TPDUHook
}

func (*GTPUConfig) SetDefaults

func (cfg *GTPUConfig) SetDefaults()

type SessionConfig

type SessionConfig struct {
	IdBase             uint16
	UEIP               net.IP
	PGWIP              net.IP
	SGWIP              net.IP
	AppName            string
	Redirect           bool
	NoADFSDFFilter     string
	Mode               UPGMode
	TEIDPGWs5u         uint32
	TEIDSGWs5u         uint32
	ProxyAccessIP      net.IP
	ProxyCoreIP        net.IP
	ProxyAccessTEID    uint32
	ProxyCoreTEID      uint32
	NoURRs             bool
	MonitoringTime     time.Time
	VTime              time.Duration
	MeasurementPeriod  time.Duration
	VolumeQuota        uint32
	ForwardingPolicyID string
	NatPoolName        string
	IMSI               string
	IPFIXTemplate      string
	SkipSDFFilter      bool
}

func (SessionConfig) CreateFARs

func (cfg SessionConfig) CreateFARs(flag uint8) []*ie.IE

func (SessionConfig) CreateOrUpdateURR

func (cfg SessionConfig) CreateOrUpdateURR(id uint32, update bool) *ie.IE

func (SessionConfig) CreatePDRs

func (cfg SessionConfig) CreatePDRs() []*ie.IE

func (SessionConfig) CreateURRs

func (cfg SessionConfig) CreateURRs() []*ie.IE

func (SessionConfig) CreateVolumeURR

func (cfg SessionConfig) CreateVolumeURR(id, tvol uint32) *ie.IE

func (SessionConfig) DeleteFARs

func (cfg SessionConfig) DeleteFARs() []*ie.IE

func (SessionConfig) DeletePDRs

func (cfg SessionConfig) DeletePDRs() []*ie.IE

func (SessionConfig) DeleteURR

func (cfg SessionConfig) DeleteURR(id uint32) *ie.IE

func (SessionConfig) DeleteURRs

func (cfg SessionConfig) DeleteURRs() []*ie.IE

func (SessionConfig) SessionIEs

func (cfg SessionConfig) SessionIEs() []*ie.IE

func (SessionConfig) UpdateURRs

func (cfg SessionConfig) UpdateURRs() []*ie.IE

type TPDUHook

type TPDUHook sgw.TPDUHook

type UPGIPMode

type UPGIPMode int
const (
	UPGIPModeNone UPGIPMode = iota
	UPGIPModeV4
	UPGIPModeV6
)

type UPGMode

type UPGMode int
const (
	UPGModeNone UPGMode = iota
	UPGModePGW
	UPGModeTDF
	UPGModeGTPProxy
)

Jump to

Keyboard shortcuts

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