tests

package
v0.0.0-...-db62745 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultApplicationServiceAccount = "eirini"

Variables

This section is empty.

Functions

func CopyRolesAndBindings

func CopyRolesAndBindings(namespace string, clientset kubernetes.Interface)

func CreatePodCreationPSP

func CreatePodCreationPSP(namespace, pspName, serviceAccountName string, clientset kubernetes.Interface) error

func CreateRandomNamespace

func CreateRandomNamespace(clientset kubernetes.Interface) string

func DeleteNamespace

func DeleteNamespace(namespace string, clientset kubernetes.Interface) error

func DeletePSP

func DeletePSP(name string, clientset kubernetes.Interface) error

func EatsFailHandler

func EatsFailHandler(message string, callerSkip ...int)

func ExposeAsService

func ExposeAsService(clientset kubernetes.Interface, namespace, guid string, appPort int32, pingPath ...string) string

func GenerateGUID

func GenerateGUID() string

func GenerateKeyPair

func GenerateKeyPair(name string) (string, string)

func GenerateKeyPairDir

func GenerateKeyPairDir(name, domain string) (string, []byte)

GenerateKeyPairDir generates a key pair in a temporary folder, returning its path and the authority PEM. The two files will be called <name>.crt and <name>.key

func GetApplicationServiceAccount

func GetApplicationServiceAccount() string

func GetEiriniAddress

func GetEiriniAddress() string

func GetEiriniDockerHubPassword

func GetEiriniDockerHubPassword() string

func GetEiriniSystemNamespace

func GetEiriniSystemNamespace() string

func GetEiriniWorkloadsNamespace

func GetEiriniWorkloadsNamespace() string

func GetKubeconfig

func GetKubeconfig() string

func GetTelepresencePort

func GetTelepresencePort() int

func GetTelepresenceServiceName

func GetTelepresenceServiceName() string

func NewContext

func NewContext(parent context.Context, name string) context.Context

func NewWiremock

func NewWiremock() *wiremock.Wiremock

func RequestServiceFn

func RequestServiceFn(namespace, serviceName string, port int32, requestPath string) func() (string, error)

func RetryResolveHost

func RetryResolveHost(host, failureMessage string)

func WriteTempFile

func WriteTempFile(content []byte, fileName string) string

Types

type EATSFixture

type EATSFixture struct {
	Fixture

	Wiremock         *wiremock.Wiremock
	DynamicClientset dynamic.Interface
	// contains filtered or unexported fields
}

func NewEATSFixture

func NewEATSFixture(baseFixture Fixture, dynamicClientset dynamic.Interface, wiremock *wiremock.Wiremock) *EATSFixture

func (*EATSFixture) GetEiriniHTTPClient

func (f *EATSFixture) GetEiriniHTTPClient() *http.Client

func (*EATSFixture) GetEiriniWorkloadsNamespace

func (f *EATSFixture) GetEiriniWorkloadsNamespace() string

func (*EATSFixture) GetNATSPassword

func (f *EATSFixture) GetNATSPassword() string

func (*EATSFixture) SetUp

func (f *EATSFixture) SetUp()

func (*EATSFixture) TearDown

func (f *EATSFixture) TearDown()

type Fixture

type Fixture struct {
	Clientset      kubernetes.Interface
	Namespace      string
	PspName        string
	KubeConfigPath string
	Writer         io.Writer
	// contains filtered or unexported fields
}

func NewFixture

func NewFixture(writer io.Writer) *Fixture

func (*Fixture) CreateExtraNamespace

func (f *Fixture) CreateExtraNamespace() string

func (*Fixture) Destroy

func (f *Fixture) Destroy()

func (*Fixture) NextAvailablePort

func (f *Fixture) NextAvailablePort() int

func (*Fixture) SetUp

func (f *Fixture) SetUp()

func (*Fixture) TearDown

func (f *Fixture) TearDown()

type TestLogger

type TestLogger struct {
	lager.Logger
	*TestSink
}

func NewTestLogger

func NewTestLogger(component string) *TestLogger

type TestSink

type TestSink struct {
	lager.Sink

	Errors []error
	// contains filtered or unexported fields
}

func NewTestSink

func NewTestSink() *TestSink

func (*TestSink) Buffer

func (s *TestSink) Buffer() *gbytes.Buffer

func (*TestSink) Log

func (s *TestSink) Log(log lager.LogFormat)

func (*TestSink) LogMessages

func (s *TestSink) LogMessages() []string

func (*TestSink) Logs

func (s *TestSink) Logs() []lager.LogFormat

Directories

Path Synopsis
eats
api

Jump to

Keyboard shortcuts

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