utils

package
v3.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RetryCount       = 10
	RetryWaitTime    = 5 * time.Second
	RetryMaxWaitTime = 1 * time.Minute
)

Variables

View Source
var (
	MockManagementPlaneAPIAddress          string
	AuxiliaryMockManagementPlaneAPIAddress string
)
View Source
var (
	Container                                 testcontainers.Container
	MockManagementPlaneGrpcContainer          testcontainers.Container
	AuxiliaryMockManagementPlaneGrpcContainer testcontainers.Container
	MockManagementPlaneGrpcAddress            string
	AuxiliaryMockManagementPlaneGrpcAddress   string
)

Functions

func CheckManifestFile added in v3.3.1

func CheckManifestFile(t *testing.T, container testcontainers.Container,
	expectedContent map[string]*model.ManifestFile,
)

func ClearManagementPlaneResponses

func ClearManagementPlaneResponses(t *testing.T, mockManagementPlaneAPIAddress string)

func CreateContainerNetwork added in v3.3.1

func CreateContainerNetwork(ctx context.Context, tb testing.TB) *testcontainers.DockerNetwork

CreateContainerNetwork creates and configures a container network.

func CurrentFileOverview added in v3.2.0

func CurrentFileOverview(t *testing.T, nginxInstanceID, mockManagementPlaneAPIAddress string) *mpi.FileOverview

func ManagementPlaneResponses

func ManagementPlaneResponses(t *testing.T, numberOfExpectedResponses int,
	mockManagementPlaneAPIAddress string,
) []*mpi.DataPlaneResponse

func PerformConfigApply

func PerformConfigApply(t *testing.T, nginxInstanceID, mockManagementPlaneAPIAddress string)

func PerformInvalidConfigApply

func PerformInvalidConfigApply(t *testing.T, nginxInstanceID string)

func SetupConnectionTest

func SetupConnectionTest(tb testing.TB, expectNoErrorsInLogs, nginxless, auxiliaryServer bool,
	agentConfig string,
) func(tb testing.TB)

func SetupMockManagementPlaneGrpc added in v3.3.1

func SetupMockManagementPlaneGrpc(ctx context.Context, tb testing.TB, containerNetwork *testcontainers.DockerNetwork)

SetupMockManagementPlaneGrpc initializes the mock management plane gRPC container.

func VerifyConnection

func VerifyConnection(t *testing.T, instancesLength int, mockManagementPlaneAPIAddress string) string

func VerifyUpdateDataPlaneHealth

func VerifyUpdateDataPlaneHealth(t *testing.T, mockManagementPlaneAPIAddress string)

func VerifyUpdateDataPlaneStatus

func VerifyUpdateDataPlaneStatus(t *testing.T, mockManagementPlaneAPIAddress string)

func WriteConfigFileDataplane added in v3.3.1

func WriteConfigFileDataplane(t *testing.T, file1, file2, file3 string)

func WriteConfigFileMock added in v3.3.1

func WriteConfigFileMock(t *testing.T, nginxInstanceID, file1, file2, file3 string)

Types

type ConnectionRequest

type ConnectionRequest struct {
	ConnectionRequest *mpi.CreateConnectionRequest `json:"connectionRequest"`
}

type Instance

type Instance struct {
	InstanceMeta    *mpi.InstanceMeta    `json:"instance_meta"`
	InstanceRuntime *mpi.InstanceRuntime `json:"instance_runtime"`
}

type NginxUpdateDataPlaneHealthRequest

type NginxUpdateDataPlaneHealthRequest struct {
	MessageMeta *mpi.MessageMeta `json:"message_meta"`
	Instances   []Instance       `json:"instances"`
}

type UpdateDataPlaneStatusRequest

type UpdateDataPlaneStatusRequest struct {
	UpdateDataPlaneStatusRequest NginxUpdateDataPlaneHealthRequest `json:"updateDataPlaneStatusRequest"`
}

Jump to

Keyboard shortcuts

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