tests

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 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 ConfigureWorkloadsNamespace added in v0.5.0

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

func CopyRolesAndBindings

func CopyRolesAndBindings(namespace string, clientset kubernetes.Interface)

func CreateRandomNamespace

func CreateRandomNamespace(clientset kubernetes.Interface) string

func CreateRegistrySecret added in v0.12.0

func CreateRegistrySecret(ctx context.Context, clientset kubernetes.Interface, name, namespace, username, password, forImage string) *corev1.Secret

func DeleteNamespace

func DeleteNamespace(namespace 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 added in v0.4.0

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

func RequestService added in v0.6.0

func RequestService(namespace, serviceName string, port int32, requestPath string) string

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

	DynamicClientset dynamic.Interface
}

func NewEATSFixture

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

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
	EiriniClientset eiriniclient.Interface
	RuntimeClient   runtimeclient.Client
	Namespace       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 added in v0.4.0

type TestLogger struct {
	lager.Logger
	*TestSink
}

func NewTestLogger added in v0.4.0

func NewTestLogger(component string) *TestLogger

type TestSink added in v0.4.0

type TestSink struct {
	lager.Sink

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

func NewTestSink added in v0.4.0

func NewTestSink() *TestSink

func (*TestSink) Buffer added in v0.4.0

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

func (*TestSink) Log added in v0.4.0

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

func (*TestSink) LogMessages added in v0.4.0

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

func (*TestSink) Logs added in v0.4.0

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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