framework

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: LGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Poll how often to poll for conditions
	Poll = 3 * time.Second

	// DefaultTimeout time to wait for operations to complete
	DefaultTimeout = 3 * time.Minute
)

Variables

View Source
var RunID = uuid.NewUUID()

RunID unique identifier of the e2e run

Functions

func CreateKubeNamespace

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

CreateKubeNamespace creates a new namespace in the cluster

func DeleteClusterRoleBinding

func DeleteClusterRoleBinding(c kubernetes.Interface, name string) error

DeleteClusterRoleBinding deletes a ClusterRoleBinding

func DeleteKubeNamespace

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

DeleteKubeNamespace deletes a namespace and all the objects inside

func ExpectNoError

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

ExpectNoError tests whether an error occurred.

func Failf

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

Failf logs to the INFO logs and fails the test.

func InstallReainbondOperator

func InstallReainbondOperator(operatorName, chartsPath, namespace string) error

func Logf

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

Logf logs to the INFO logs.

func NewInt32

func NewInt32(val int32) *int32

NewInt32 converts int32 to a pointer

func NewInt64

func NewInt64(val int64) *int64

NewInt64 converts int64 to a pointer

func RestclientConfig

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

RestclientConfig deserializes the contents of a kubeconfig file into a Config object.

func Skipf

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

Skipf logs to the INFO logs and skips the test.

func WaitForFileInFS

func WaitForFileInFS(file string) error

WaitForFileInFS waits a default amount of time for the specified file is present in the filesystem

func WaitForIngressInNamespace

func WaitForIngressInNamespace(c kubernetes.Interface, namespace, name string) error

WaitForIngressInNamespace waits until a particular ingress object exists namespace

func WaitForKubeNamespaceNotExist

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

WaitForKubeNamespaceNotExist waits until a namespaces is not present in the cluster

func WaitForNoIngressInNamespace

func WaitForNoIngressInNamespace(c kubernetes.Interface, namespace, name string) error

WaitForNoIngressInNamespace waits until there is no ingress object in a particular namespace

func WaitForNoPodsInNamespace

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

WaitForNoPodsInNamespace waits until there are no pods running in a namespace

func WaitForPodRunningInNamespace

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

WaitForPodRunningInNamespace waits a 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.

func WaitForPodsReady

func WaitForPodsReady(kubeClientSet kubernetes.Interface, timeout time.Duration, expectedReplicas int, namespace string, opts metav1.ListOptions) error

WaitForPodsReady waits for a given amount of time until a group of Pods is running in the given namespace.

func WaitForSecretInNamespace

func WaitForSecretInNamespace(c kubernetes.Interface, namespace, name string) error

WaitForSecretInNamespace waits a default amount of time for the specified secret is present in a particular namespace

Types

type Framework

type Framework struct {
	BaseName string

	// A Kubernetes and Service Catalog client
	KubeClientSet     kubernetes.Interface
	KubeConfig        *restclient.Config
	RainbondClientset rainbondoperator.Interface

	Namespace    string
	OperatorName string
}

Framework supports common operations used by e2e tests; it will keep a kubernetes cluster for you.

func NewDefaultFramework

func NewDefaultFramework(baseName string) *Framework

NewDefaultFramework 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) EnsureRainbondCluster

EnsureRainbondCluster creates a rainbondcluster object or returns it if it already exists.

Jump to

Keyboard shortcuts

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