suite

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: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpectDeleteResource

func ExpectDeleteResource(t *testing.T, w types.Watcher, timeout time.Duration, resource types.Resource)

ExpectDeleteResource expects a delete event of a certain kind

func ExpectResource

func ExpectResource(t *testing.T, w types.Watcher, timeout time.Duration, resource types.Resource)

ExpectResource expects a Put event of a certain resource

func NewServer

func NewServer(kind, name, addr, namespace string) *types.ServerV2

NewServer creates a new server resource

func NewTestCA

func NewTestCA(caType types.CertAuthType, clusterName string, privateKeys ...[]byte) *types.CertAuthorityV2

NewTestCA returns new test authority with a test key as a public and signing key

func NewTestCAWithConfig

func NewTestCAWithConfig(config TestCAConfig) *types.CertAuthorityV2

NewTestCAWithConfig generates a new certificate authority with the specified configuration Keep this function in-sync with lib/auth/auth.go:newKeySet(). TODO(jakule): reuse keystore.KeyStore interface to match newKeySet().

Types

type Option

type Option func(s *Options)

Option is a functional suite option

func SkipDelete

func SkipDelete() Option

SkipDelete instructs tests to skip testing delete features

type Options

type Options struct {
	// SkipDelete turns off deletes in tests
	SkipDelete bool
}

Options provides functional arguments to turn certain parts of the test suite off

func CollectOptions

func CollectOptions(opts ...Option) Options

CollectOptions collects suite options

type ServicesTestSuite

type ServicesTestSuite struct {
	Access        services.Access
	CAS           services.Trust
	PresenceS     services.Presence
	ProvisioningS services.Provisioner
	WebS          services.Identity
	ConfigS       services.ClusterConfiguration
	EventsS       types.Events
	UsersS        services.UsersService
	RestrictionsS services.Restrictions
	ChangesC      chan interface{}
	Clock         clockwork.FakeClock
}

ServicesTestSuite is an acceptance test suite for services. It is used for local implementations and implementations using GRPC to guarantee consistency between local and remote services

func (*ServicesTestSuite) AppServerCRUD

func (s *ServicesTestSuite) AppServerCRUD(t *testing.T)

AppServerCRUD tests CRUD functionality for services.Server.

func (*ServicesTestSuite) AuthPreference

func (s *ServicesTestSuite) AuthPreference(t *testing.T)

AuthPreference tests authentication preference service

func (*ServicesTestSuite) CertAuthCRUD

func (s *ServicesTestSuite) CertAuthCRUD(t *testing.T)

func (*ServicesTestSuite) ClusterName

func (s *ServicesTestSuite) ClusterName(t *testing.T, opts ...Option)

ClusterName tests cluster name.

func (*ServicesTestSuite) ClusterNetworkingConfig

func (s *ServicesTestSuite) ClusterNetworkingConfig(t *testing.T)

ClusterNetworkingConfig tests cluster networking configuration.

func (*ServicesTestSuite) Events

func (s *ServicesTestSuite) Events(t *testing.T)

Events tests various events variations

func (*ServicesTestSuite) EventsClusterConfig

func (s *ServicesTestSuite) EventsClusterConfig(t *testing.T)

EventsClusterConfig tests cluster config resource events

func (*ServicesTestSuite) GithubConnectorCRUD

func (s *ServicesTestSuite) GithubConnectorCRUD(t *testing.T)

func (*ServicesTestSuite) LoginAttempts

func (s *ServicesTestSuite) LoginAttempts(t *testing.T)

func (*ServicesTestSuite) NamespacesCRUD

func (s *ServicesTestSuite) NamespacesCRUD(t *testing.T)

func (*ServicesTestSuite) NetworkRestrictions

func (s *ServicesTestSuite) NetworkRestrictions(t *testing.T, opts ...Option)

NetworkRestrictions tests network restrictions.

func (*ServicesTestSuite) PasswordHashCRUD

func (s *ServicesTestSuite) PasswordHashCRUD(t *testing.T)

func (*ServicesTestSuite) RemoteClustersCRUD

func (s *ServicesTestSuite) RemoteClustersCRUD(t *testing.T)

func (*ServicesTestSuite) ReverseTunnelsCRUD

func (s *ServicesTestSuite) ReverseTunnelsCRUD(t *testing.T)

func (*ServicesTestSuite) RolesCRUD

func (s *ServicesTestSuite) RolesCRUD(t *testing.T)

func (*ServicesTestSuite) SAMLCRUD

func (s *ServicesTestSuite) SAMLCRUD(t *testing.T)

func (*ServicesTestSuite) SemaphoreConcurrency

func (s *ServicesTestSuite) SemaphoreConcurrency(t *testing.T)

SemaphoreConcurrency verifies that a large number of concurrent acquisitions result in the correct number of successful acquisitions.

func (*ServicesTestSuite) SemaphoreContention

func (s *ServicesTestSuite) SemaphoreContention(t *testing.T)

SemaphoreContention checks that a large number of concurrent acquisitions all succeed if MaxLeases is sufficiently high. Note that we do not test the same property holds for releasing semaphores; release operations are best-effort and allowed to fail. Also, "large" in this context is still fairly small. Semaphores aren't cheap and the auth server is expected to start returning "too much contention" errors at around 100 concurrent attempts.

func (*ServicesTestSuite) SemaphoreFlakiness

func (s *ServicesTestSuite) SemaphoreFlakiness(t *testing.T)

func (*ServicesTestSuite) SemaphoreLock

func (s *ServicesTestSuite) SemaphoreLock(t *testing.T)

SemaphoreLock verifies correct functionality of the basic semaphore lock scenarios.

func (*ServicesTestSuite) ServerCRUD

func (s *ServicesTestSuite) ServerCRUD(t *testing.T)

func (*ServicesTestSuite) SessionRecordingConfig

func (s *ServicesTestSuite) SessionRecordingConfig(t *testing.T)

SessionRecordingConfig tests session recording configuration.

func (*ServicesTestSuite) StaticTokens

func (s *ServicesTestSuite) StaticTokens(t *testing.T)

func (*ServicesTestSuite) TokenCRUD

func (s *ServicesTestSuite) TokenCRUD(t *testing.T)

func (*ServicesTestSuite) TunnelConnectionsCRUD

func (s *ServicesTestSuite) TunnelConnectionsCRUD(t *testing.T)

func (*ServicesTestSuite) Users

func (*ServicesTestSuite) UsersCRUD

func (s *ServicesTestSuite) UsersCRUD(t *testing.T)

func (*ServicesTestSuite) UsersExpiry

func (s *ServicesTestSuite) UsersExpiry(t *testing.T)

func (*ServicesTestSuite) WebSessionCRUD

func (s *ServicesTestSuite) WebSessionCRUD(t *testing.T)

type TestCAConfig

type TestCAConfig struct {
	Type        types.CertAuthType
	ClusterName string
	PrivateKeys [][]byte
	Clock       clockwork.Clock
}

TestCAConfig defines the configuration for generating a test certificate authority

Jump to

Keyboard shortcuts

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