testhelpers

package
v0.0.0-...-5c79d48 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultBotConfig

func DefaultBotConfig(
	t *testing.T, fc *config.FileConfig, onboarding *botconfig.OnboardingConfig, outputs []botconfig.Output, opts DefaultBotConfigOpts,
) *botconfig.BotConfig

DefaultBotConfig creates a usable bot config from joining parameters. By default it: - Has the outputs provided to it via the parameter `outputs` - Runs in oneshot mode - Uses a memory storage destination - Does not verify Proxy WebAPI certificates

func DefaultConfig

func DefaultConfig(t *testing.T) (*config.FileConfig, []*servicecfg.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 []*servicecfg.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) (*botconfig.OnboardingConfig, *machineidv1pb.Bot)

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

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.

Types

type DefaultBotConfigOpts

type DefaultBotConfigOpts struct {
	// Makes the bot connect via the Auth Server instead of the Proxy server.
	UseAuthServer bool

	// Makes the bot accept an Insecure auth or proxy server
	Insecure bool
}

Jump to

Keyboard shortcuts

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