Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions internal/tester/scenarios/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

package scenarios

import "time"

// Defaults the integration suite provisions on Core and scenarios consume
// directly, keeping a single source of truth for both.
const (
Expand Down Expand Up @@ -48,4 +50,9 @@ const (

// DefaultProbePort is the TCP/UDP echo port exposed by the on-N6 responder.
DefaultProbePort = 34242

// NGSetupTimeout bounds the wait for an NG Setup outcome. The AMF reads
// operator configuration and network slices from storage before it can
// answer, so the wait has to absorb database latency on a loaded runner.
NGSetupTimeout = 5 * time.Second
)
3 changes: 1 addition & 2 deletions internal/tester/scenarios/enb/connectivity.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"fmt"
"os/exec"
"strconv"
"time"

"github.com/ellanetworks/core/internal/tester/enb"
"github.com/ellanetworks/core/internal/tester/gnb"
Expand Down Expand Up @@ -132,7 +131,7 @@ func runEnbConnectivity(ctx context.Context, env scenarios.Env, _ any) error {

defer ngeNB.Close()

_, err = ngeNB.WaitForMessage(gnb.Successful, ngap.ProcNGSetup, 200*time.Millisecond)
_, err = ngeNB.WaitForMessage(gnb.Successful, ngap.ProcNGSetup, scenarios.NGSetupTimeout)
if err != nil {
return fmt.Errorf("did not receive SCTP frame: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/tester/scenarios/enb/deregistration.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func runEnbDeregistration(_ context.Context, env scenarios.Env, _ any) error {

defer ngeNB.Close()

_, err = ngeNB.WaitForMessage(gnb.Successful, ngap.ProcNGSetup, 200*time.Millisecond)
_, err = ngeNB.WaitForMessage(gnb.Successful, ngap.ProcNGSetup, scenarios.NGSetupTimeout)
if err != nil {
return fmt.Errorf("did not receive SCTP frame: %v", err)
}
Expand Down
3 changes: 1 addition & 2 deletions internal/tester/scenarios/enb/multi_ue_registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package enb
import (
"context"
"fmt"
"time"

"github.com/ellanetworks/core/internal/tester/enb"
"github.com/ellanetworks/core/internal/tester/gnb"
Expand Down Expand Up @@ -71,7 +70,7 @@ func runEnbMultiUERegistration(_ context.Context, env scenarios.Env, _ any) erro

defer ngeNB.Close()

_, err = ngeNB.WaitForMessage(gnb.Successful, ngap.ProcNGSetup, 200*time.Millisecond)
_, err = ngeNB.WaitForMessage(gnb.Successful, ngap.ProcNGSetup, scenarios.NGSetupTimeout)
if err != nil {
return fmt.Errorf("did not receive SCTP frame: %v", err)
}
Expand Down
3 changes: 1 addition & 2 deletions internal/tester/scenarios/enb/ng_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package enb
import (
"context"
"fmt"
"time"

"github.com/ellanetworks/core/internal/tester/enb"
"github.com/ellanetworks/core/internal/tester/gnb"
Expand Down Expand Up @@ -50,7 +49,7 @@ func runNgSetup(_ context.Context, env scenarios.Env, _ any) error {
if _, err := node.WaitForMessage(
gnb.Successful,
ngap.ProcNGSetup,
1*time.Second,
scenarios.NGSetupTimeout,
); err != nil {
return fmt.Errorf("wait NGSetupResponse: %w", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func runAuthenticationWrongKey(_ context.Context, env scenarios.Env, _ any) erro

defer gNodeB.Close()

_, err = gNodeB.WaitForMessage(gnb.Successful, ngap.ProcNGSetup, 200*time.Millisecond)
_, err = gNodeB.WaitForMessage(gnb.Successful, ngap.ProcNGSetup, scenarios.NGSetupTimeout)
if err != nil {
return fmt.Errorf("timeout waiting for NGSetupComplete: %v", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"context"
"fmt"
"net/netip"
"time"

"github.com/ellanetworks/core/internal/models"
"github.com/ellanetworks/core/internal/tester/gnb"
Expand Down Expand Up @@ -146,7 +145,7 @@ func runConnectivityMultiPDUSession(ctx context.Context, env scenarios.Env, _ an

defer gNodeB.Close()

_, err = gNodeB.WaitForMessage(gnb.Successful, ngap.ProcNGSetup, 200*time.Millisecond)
_, err = gNodeB.WaitForMessage(gnb.Successful, ngap.ProcNGSetup, scenarios.NGSetupTimeout)
if err != nil {
return fmt.Errorf("did not receive NG Setup Response: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/tester/scenarios/gnb/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func startGNB(env scenarios.Env) (*gnb.GnodeB, error) {
return nil, fmt.Errorf("start gNB: %w", err)
}

if _, err := gNodeB.WaitForMessage(gnb.Successful, ngap.ProcNGSetup, 200*time.Millisecond); err != nil {
if _, err := gNodeB.WaitForMessage(gnb.Successful, ngap.ProcNGSetup, scenarios.NGSetupTimeout); err != nil {
gNodeB.Close()

return nil, fmt.Errorf("await NG Setup Response: %w", err)
Expand Down
3 changes: 1 addition & 2 deletions internal/tester/scenarios/gnb/location.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package gnb
import (
"context"
"fmt"
"time"

"github.com/ellanetworks/core/client"
"github.com/ellanetworks/core/internal/tester/gnb"
Expand Down Expand Up @@ -87,7 +86,7 @@ func runLocationTest(ctx context.Context, env scenarios.Env, p *locationParams)

defer gNodeB.Close()

_, err = gNodeB.WaitForMessage(gnb.Successful, ngap.ProcNGSetup, 200*time.Millisecond)
_, err = gNodeB.WaitForMessage(gnb.Successful, ngap.ProcNGSetup, scenarios.NGSetupTimeout)
if err != nil {
return fmt.Errorf("did not receive NG Setup Response: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/tester/scenarios/gnb/ng_reset.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func runNGReset(_ context.Context, env scenarios.Env, _ any) error {
if _, err := node.WaitForMessage(
gnb.Successful,
ngaplib.ProcNGSetup,
200*time.Millisecond,
scenarios.NGSetupTimeout,
); err != nil {
return fmt.Errorf("wait NGSetupResponse: %w", err)
}
Expand Down
3 changes: 1 addition & 2 deletions internal/tester/scenarios/gnb/ng_setup_failure.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package gnb
import (
"context"
"fmt"
"time"

"github.com/ellanetworks/core/internal/tester/gnb"
"github.com/ellanetworks/core/internal/tester/scenarios"
Expand Down Expand Up @@ -48,7 +47,7 @@ func runNGSetupFailureUnknownPLMN(_ context.Context, env scenarios.Env, _ any) e
frame, err := node.WaitForMessage(
gnb.Unsuccessful,
ngap.ProcNGSetup,
200*time.Millisecond,
scenarios.NGSetupTimeout,
)
if err != nil {
return fmt.Errorf("wait NGSetupFailure: %w", err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func runRANConfigurationUpdate(_ context.Context, env scenarios.Env, _ any) erro
if _, err := node.WaitForMessage(
gnb.Successful,
ngap.ProcNGSetup,
200*time.Millisecond,
scenarios.NGSetupTimeout,
); err != nil {
return fmt.Errorf("wait NGSetupResponse: %w", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"context"
"fmt"
"net/netip"
"time"

"github.com/ellanetworks/core/internal/tester/gnb"
"github.com/ellanetworks/core/internal/tester/scenarios"
Expand Down Expand Up @@ -99,7 +98,7 @@ func runRegistrationSuccessMultipleDataNetworks(_ context.Context, env scenarios

defer gNodeB.Close()

_, err = gNodeB.WaitForMessage(gnb.Successful, ngap.ProcNGSetup, 200*time.Millisecond)
_, err = gNodeB.WaitForMessage(gnb.Successful, ngap.ProcNGSetup, scenarios.NGSetupTimeout)
if err != nil {
return fmt.Errorf("did not receive SCTP frame: %v", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func runRegistrationSuccessMultipleSlices(_ context.Context, env scenarios.Env,

defer gNodeB.Close()

_, err = gNodeB.WaitForMessage(gnb.Successful, ngap.ProcNGSetup, 200*time.Millisecond)
_, err = gNodeB.WaitForMessage(gnb.Successful, ngap.ProcNGSetup, scenarios.NGSetupTimeout)
if err != nil {
return fmt.Errorf("did not receive NG Setup Response: %v", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package gnb
import (
"context"
"fmt"
"time"

"github.com/ellanetworks/core/internal/tester/gnb"
"github.com/ellanetworks/core/internal/tester/scenarios"
Expand Down Expand Up @@ -83,7 +82,7 @@ func runRegistrationSuccessNoSD(_ context.Context, env scenarios.Env, _ any) err

defer gNodeB.Close()

_, err = gNodeB.WaitForMessage(gnb.Successful, ngap.ProcNGSetup, 200*time.Millisecond)
_, err = gNodeB.WaitForMessage(gnb.Successful, ngap.ProcNGSetup, scenarios.NGSetupTimeout)
if err != nil {
return fmt.Errorf("did not receive SCTP frame: %v", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"crypto/ecdh"
"encoding/hex"
"fmt"
"time"

"github.com/ellanetworks/core/internal/tester/gnb"
"github.com/ellanetworks/core/internal/tester/scenarios"
Expand Down Expand Up @@ -96,7 +95,7 @@ func runRegistrationSuccessProfileA(_ context.Context, env scenarios.Env, params
if _, err := gNodeB.WaitForMessage(
gnb.Successful,
ngap.ProcNGSetup,
200*time.Millisecond,
scenarios.NGSetupTimeout,
); err != nil {
return fmt.Errorf("wait NGSetupResponse: %w", err)
}
Expand Down
3 changes: 1 addition & 2 deletions internal/tester/scenarios/gnb/sctp_basics.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package gnb
import (
"context"
"fmt"
"time"

"github.com/ellanetworks/core/internal/tester/gnb"
"github.com/ellanetworks/core/internal/tester/logger"
Expand Down Expand Up @@ -50,7 +49,7 @@ func runSCTPBasic(ctx context.Context, env scenarios.Env, _ any) error {
fr, err := node.WaitForMessage(
gnb.Successful,
ngap.ProcNGSetup,
200*time.Millisecond,
scenarios.NGSetupTimeout,
)
if err != nil {
return fmt.Errorf("wait for NG Setup Response: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion internal/tester/scenarios/interworking/interworking.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func startGNB(env scenarios.Env) (*gnb.GnodeB, error) {
return nil, fmt.Errorf("start gNB: %w", err)
}

if _, err := gNodeB.WaitForMessage(gnb.Successful, ngap.ProcNGSetup, 200*time.Millisecond); err != nil {
if _, err := gNodeB.WaitForMessage(gnb.Successful, ngap.ProcNGSetup, scenarios.NGSetupTimeout); err != nil {
gNodeB.Close()

return nil, fmt.Errorf("await NG Setup Response: %w", err)
Expand Down
3 changes: 1 addition & 2 deletions internal/tester/scenarios/multi/cluster_traffic_5g.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"strconv"
"strings"
"sync"
"time"

"github.com/ellanetworks/core/etsi"
"github.com/ellanetworks/core/internal/tester/gnb"
Expand Down Expand Up @@ -89,7 +88,7 @@ func runClusterTraffic(ctx context.Context, env scenarios.Env, p *clusterTraffic
if _, err := gNodeB.WaitForMessage(
gnb.Successful,
ngap.ProcNGSetup,
5*time.Second,
scenarios.NGSetupTimeout,
); err != nil {
return fmt.Errorf("NG Setup Response: %w", err)
}
Expand Down
Loading