fixture

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package fixture provides per-subtest builders over the Ella Core client SDK for provisioning scenario fixtures (operator, profiles, slices, data networks, policies, subscribers).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertUsagePositive

func AssertUsagePositive(ctx context.Context, t *testing.T, c *client.Client, imsis []string, timeout time.Duration)

AssertUsagePositive polls Core until uplink and downlink bytes are both > 0 for every IMSI, or the deadline passes. Fails the subtest on timeout.

Types

type DataNetworkSpec

type DataNetworkSpec struct {
	Name   string
	IPPool string
	DNS    string
	MTU    int32
}

DataNetworkSpec describes a PDU session anchor (DNN + IP pool).

func DefaultDataNetworkSpec

func DefaultDataNetworkSpec() DataNetworkSpec

type F

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

F is a fixture builder bound to one subtest. Methods fail the test via t.Fatalf on API error.

func New

func New(t *testing.T, ctx context.Context, c *client.Client) *F

func (*F) Apply

func (f *F) Apply(spec scenarios.FixtureSpec)

Apply provisions every scenario-owned resource in spec and registers t.Cleanup handlers to delete them when the subtest ends. LIFO cleanup order gives the correct reverse-dependency teardown: subscribers, policies, data networks, slices, profiles.

Scoped resources use strict-create semantics — a name collision fails the test so that stray state from a prior run surfaces immediately instead of silently mutating shared state.

Non-scoped resources (operator singleton, home network keys) are applied idempotently and are not cleaned up; they belong to the baseline shared across all subtests.

Rule for scenario authors: reference baseline names (default profile/slice/DN/policy) only when assertions match baseline values. Anything else must be declared under a scoped name.

func (*F) DataNetwork

func (f *F) DataNetwork(spec DataNetworkSpec)

DataNetwork creates the baseline data network if none with the given name exists. A pre-existing DN is left untouched; scenarios needing specific DN parameters must use a distinct name.

func (*F) HomeNetworkKey

func (f *F) HomeNetworkKey(spec HomeNetworkKeySpec)

HomeNetworkKey creates a home network key unless the operator already serves one with the matching public key.

func (*F) Operator

func (f *F) Operator(spec OperatorSpec)

Operator writes the operator ID and tracking TACs.

func (*F) OperatorDefault

func (f *F) OperatorDefault()

OperatorDefault writes scenarios-package defaults to the operator.

func (*F) Policy

func (f *F) Policy(spec PolicySpec)

Policy upserts the baseline policy: when it already exists (e.g. Core's seeded "default"), its config is overwritten to match spec.

func (*F) Profile

func (f *F) Profile(spec ProfileSpec)

Profile upserts the baseline profile: when it already exists (e.g. Core's seeded "default"), its UE-AMBR is overwritten to match spec.

func (*F) Slice

func (f *F) Slice(spec SliceSpec)

Slice upserts the baseline slice: when it already exists, its SST/SD are overwritten to match spec.

type HomeNetworkKeySpec

type HomeNetworkKeySpec struct {
	KeyIdentifier int
	Scheme        string
	PrivateKey    string
}

HomeNetworkKeySpec carries a hex-encoded X25519 private key and a key identifier.

type OperatorSpec

type OperatorSpec struct {
	MCC           string
	MNC           string
	SupportedTACs []string
}

OperatorSpec captures the singleton operator settings.

type PolicySpec

type PolicySpec struct {
	Name                string
	ProfileName         string
	SliceName           string
	DataNetworkName     string
	SessionAmbrUplink   string
	SessionAmbrDownlink string
	Var5qi              int32
	Arp                 int32
}

PolicySpec describes a QoS policy for a (profile, slice, data network) triple.

func DefaultPolicySpec

func DefaultPolicySpec() PolicySpec

type ProfileSpec

type ProfileSpec struct {
	Name           string
	UeAmbrUplink   string
	UeAmbrDownlink string
}

ProfileSpec describes a subscriber profile (UE-AMBR bucket).

func DefaultProfileSpec

func DefaultProfileSpec() ProfileSpec

type SliceSpec

type SliceSpec struct {
	Name string
	SST  int
	SD   string
}

SliceSpec describes a network slice.

func DefaultSliceSpec

func DefaultSliceSpec() SliceSpec

type SubscriberSpec

type SubscriberSpec struct {
	IMSI           string
	Key            string
	OPc            string
	SequenceNumber string
	ProfileName    string
}

SubscriberSpec describes one subscriber.

Jump to

Keyboard shortcuts

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