framework

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2018 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var RunId = uuid.NewUUID()

unique identifier of the e2e run

Functions

func CertManagerDescribe

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

Wrapper function for ginkgo describe. Adds namespacing.

func CreateCertificateCRD added in v0.1.0

func CreateCertificateCRD(c apiextcs.Interface) error

func CreateClusterIssuerCRD added in v0.1.0

func CreateClusterIssuerCRD(c apiextcs.Interface) error

func CreateIssuerCRD added in v0.1.0

func CreateIssuerCRD(c apiextcs.Interface) error

func CreateKubeNamespace added in v0.1.0

func CreateKubeNamespace(baseName string, c kubernetes.Interface) (*v1.Namespace, error)

func DeleteCertificateCRD added in v0.1.0

func DeleteCertificateCRD(c apiextcs.Interface) error

func DeleteClusterIssuerCRD added in v0.1.0

func DeleteClusterIssuerCRD(c apiextcs.Interface) error

func DeleteIssuerCRD added in v0.1.0

func DeleteIssuerCRD(c apiextcs.Interface) error

func DeleteKubeNamespace added in v0.1.0

func DeleteKubeNamespace(c kubernetes.Interface, namespace string) error

func ExpectNoError added in v0.1.0

func ExpectNoError(err error, explain ...interface{})

func Failf

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

func LoadConfig added in v0.1.0

func LoadConfig(config, context string) (*rest.Config, error)

func Logf added in v0.1.0

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

func RegisterCommonFlags added in v0.1.0

func RegisterCommonFlags()

Register flags common to all e2e test suites.

func RegisterParseFlags added in v0.1.0

func RegisterParseFlags()

func RemoveCleanupAction

func RemoveCleanupAction(p CleanupActionHandle)

RemoveCleanupAction removes a function that was installed by AddCleanupAction.

func RestclientConfig added in v0.1.0

func RestclientConfig(config, context string) (*api.Config, error)

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{})

func WaitForKubeNamespaceNotExist added in v0.2.0

func WaitForKubeNamespaceNotExist(c kubernetes.Interface, namespace string) error

func WaitForPodRunningInNamespace added in v0.1.0

func WaitForPodRunningInNamespace(c kubernetes.Interface, pod *v1.Pod) error

Waits default amount of time (PodStartTimeout) for the specified pod to become running. Returns an error if timeout occurs first, or pod goes in to failed state.

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 ClientConfigGetter added in v0.1.0

type ClientConfigGetter func() (*rest.Config, error)

type Framework

type Framework struct {
	BaseName string

	// A Kubernetes and Service Catalog client
	KubeClientSet          kubernetes.Interface
	CertManagerClientSet   clientset.Interface
	APIExtensionsClientSet apiextcs.Interface

	ACMEURL string

	// Namespace in which all test resources should reside
	Namespace *v1.Namespace
	// 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

NewFramework makes a new framework and sets up a BeforeEach/AfterEach for you (you can write additional before/after each functions).

func (*Framework) AfterEach

func (f *Framework) AfterEach()

AfterEach deletes the namespace, after reading its events.

func (*Framework) BeforeEach

func (f *Framework) BeforeEach()

BeforeEach gets a client and makes a namespace.

func (*Framework) WaitCertificateIssuedValid added in v0.3.0

func (f *Framework) WaitCertificateIssuedValid(c *v1alpha1.Certificate)

func (*Framework) WaitCertificateIssuedValidTimeout added in v0.3.0

func (f *Framework) WaitCertificateIssuedValidTimeout(c *v1alpha1.Certificate, t time.Duration)

WaitCertificateIssuedValid waits for the given Certificate to be 'Ready' and ensures the stored certificate is valid for the specified domains.

type TestContextType added in v0.1.0

type TestContextType struct {
	KubeHost    string
	KubeConfig  string
	KubeContext string

	CertManagerHost    string
	CertManagerConfig  string
	CertManagerContext string

	PebbleImageRepo string
	PebbleImageTag  string
	ACMEURL         string

	ReportDir string
}
var TestContext TestContextType

Jump to

Keyboard shortcuts

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