helpers

package
v3.0.0-...-de0fd11 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCacheFiles

func CreateCacheFiles(t testing.TB, cachePath string, cacheData map[string]*v1.FileMeta)

func CreateDirWithErrorCheck

func CreateDirWithErrorCheck(t testing.TB, dirName string)

func CreateFileWithErrorCheck

func CreateFileWithErrorCheck(t testing.TB, dir, fileName string) *os.File

func CreateTestIDs

func CreateTestIDs(t testing.TB) (correlationID, instanceID uuid.UUID)

func GenerateSelfSignedCert

func GenerateSelfSignedCert(t testing.TB) (keyBytes, certBytes []byte)

func GetGoVersion

func GetGoVersion(t testing.TB, level int) (string, error)

func GetRequiredModuleVersion

func GetRequiredModuleVersion(t testing.TB, moduleName string, level int) (string, error)

func LogAndTerminateContainers

func LogAndTerminateContainers(
	ctx context.Context,
	tb testing.TB,
	mockManagementPlaneContainer testcontainers.Container,
	agentContainer testcontainers.Container,
)

func RemoveFileWithErrorCheck

func RemoveFileWithErrorCheck(t testing.TB, fileName string)

func StartContainer

func StartContainer(
	ctx context.Context,
	tb testing.TB,
	containerNetwork *testcontainers.DockerNetwork,
	parameters *Parameters,
) testcontainers.Container

func StartMockManagementPlaneGrpcContainer

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

func ToPtr

func ToPtr[T any](value T) *T

func WriteCertFiles

func WriteCertFiles(t *testing.T, location string, cert Cert) string

Types

type Cert

type Cert struct {
	Name     string
	Type     string
	Contents []byte
}

type Parameters

type Parameters struct {
	NginxConfigPath      string
	NginxAgentConfigPath string
	LogMessage           string
}

Jump to

Keyboard shortcuts

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