testhelpers

package
v11.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfig

func DefaultConfig(t *testing.T) (*config.FileConfig, []service.FileDescriptor)

DefaultConfig returns a FileConfig to be used in tests, with random listen addresses that are tied to the listeners returned in the FileDescriptor slice, which should be passed as exported file descriptors to NewTeleport; this is to ensure that we keep the listening socket open, to prevent other processes from using the same port before we're done with it.

func MakeAndRunTestAuthServer

func MakeAndRunTestAuthServer(t *testing.T, log utils.Logger, fc *config.FileConfig, fds []service.FileDescriptor) (auth *service.TeleportProcess)

MakeAndRunTestAuthServer creates an auth server useful for testing purposes.

func MakeBot

func MakeBot(t *testing.T, client auth.ClientI, name string, roles ...string) *proto.CreateBotResponse

MakeBot creates a server-side bot and returns joining parameters.

func MakeBotAuthClient

func MakeBotAuthClient(t *testing.T, fc *config.FileConfig, ident *identity.Identity) auth.ClientI

MakeBotAuthClient creates a new auth client using a Bot identity.

func MakeDefaultAuthClient

func MakeDefaultAuthClient(t *testing.T, log utils.Logger, fc *config.FileConfig) auth.ClientI

MakeDefaultAuthClient reimplements the bare minimum needed to create a default root-level auth client for a Teleport server started by MakeAndRunTestAuthServer.

func MakeMemoryBotConfig

func MakeMemoryBotConfig(t *testing.T, fc *config.FileConfig, botParams *proto.CreateBotResponse) *botconfig.BotConfig

MakeMemoryBotConfig creates a usable bot config from joining parameters. It only writes artifacts to memory and can be further modified if desired.

Types

This section is empty.

Jump to

Keyboard shortcuts

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