framework

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// How often to poll for conditions
	Poll = 2 * time.Second
)

Variables

View Source
var DefaultConfig = &config.Config{}

DefaultConfig contains the default shared config the is likely parsed from command line arguments.

Functions

func CasesDescribe

func CasesDescribe(text string, body func()) bool

func Failf

func Failf(format string, args ...interface{})

func RemoveCleanupAction

func RemoveCleanupAction(p CleanupActionHandle)

RemoveCleanupAction removes a function that was installed by AddCleanupAction.

func RunCleanupActions

func RunCleanupActions()

RunCleanupActions runs all functions installed by AddCleanupAction. It does not remove them (see RemoveCleanupAction) but it does run unlocked, so they may remove themselves.

func Skipf

func Skipf(format string, args ...interface{})

Types

type CleanupActionHandle

type CleanupActionHandle *int

func AddCleanupAction

func AddCleanupAction(fn func()) CleanupActionHandle

AddCleanupAction installs a function that will be called in the event of the whole test being terminated. This allows arbitrary pieces of the overall test to hook into SynchronizedAfterSuite().

type Framework

type Framework struct {
	BaseName string

	Config *config.Config

	// Kubernetes API clientsets
	KubeClientSet        kubernetes.Interface
	CertManagerClientSet crclientset.Interface

	// Namespace in which all test resources should reside
	Namespace *corev1.Namespace

	// The CA Issuer and ClusterIssuer to reference
	Issuer, ClusterIssuer cmmeta.ObjectReference
	// contains filtered or unexported fields
}

Framework supports common operations used by e2e tests; it will keep a client & a namespace for you.

func NewDefaultFramework

func NewDefaultFramework(baseName string) *Framework

func NewFramework

func NewFramework(baseName string, cfg *config.Config) *Framework

func (*Framework) AfterEach

func (f *Framework) AfterEach()

AfterEach deletes the namespace, after reading its events.

func (*Framework) BeforeEach

func (f *Framework) BeforeEach()

func (*Framework) CreateCAClusterIssuer

func (f *Framework) CreateCAClusterIssuer(baseName string) (cmmeta.ObjectReference, error)

CreateCAClusterIssuer creates a CA cluster issuer used for creating certificates

func (*Framework) CreateCAIssuer

func (f *Framework) CreateCAIssuer(namespace, baseName string) (cmmeta.ObjectReference, error)

CreateCAIssuer creates a CA issuer used for creating certificates

func (*Framework) CreateKubeNamespace

func (f *Framework) CreateKubeNamespace(baseName string) (*corev1.Namespace, error)

CreateKubeNamespace creates a new Kubernetes Namespace for a test.

func (*Framework) DeleteKubeNamespace

func (f *Framework) DeleteKubeNamespace(namespace string) error

DeleteKubeNamespace will delete a namespace resource

func (*Framework) Helper

func (f *Framework) Helper() *helper.Helper

func (*Framework) RandomPod

func (f *Framework) RandomPod() *corev1.Pod

func (*Framework) WaitForKubeNamespaceNotExist

func (f *Framework) WaitForKubeNamespaceNotExist(namespace string) error

WaitForKubeNamespaceNotExist will wait for the namespace with the given name to not exist for up to 2 minutes.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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