helper

package
v0.0.0-...-93e563e Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2019 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package helper provides utilities to assist with osde2e testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type H

type H struct {
	// embed test configuration
	*config.Config
	// contains filtered or unexported fields
}

H configures clients and sets up and destroys Projects for test isolation.

func New

func New() *H

New creates H, a helper used to expose common testing functions.

func (*H) Cfg

func (h *H) Cfg() config.Interface

Cfg return a client for the Config API.

func (*H) Cleanup

func (h *H) Cleanup()

Cleanup deletes a Project after tests have been ran.

func (*H) CurrentProject

func (h *H) CurrentProject() string

CurrentProject returns the project being used for testing.

func (*H) Dynamic

func (h *H) Dynamic() dynamic.Interface

Dynamic returns a client that works on arbitrary types.

func (*H) GetClusterState

func (h *H) GetClusterState() (resources map[schema.GroupVersionResource]*unstructured.UnstructuredList)

GetClusterState retrieves the current objects in desiredClusterResources and desiredResources.

func (*H) GiveCurrentProjectClusterAdmin

func (h *H) GiveCurrentProjectClusterAdmin()

GiveCurrentProjectClusterAdmin to default service account and ensure its removed after project deletion.

func (*H) Image

func (h *H) Image() image.Interface

Image returns the clientset for images.

func (*H) Kube

func (h *H) Kube() kubernetes.Interface

Kube returns the clientset for Kubernetes upstream.

func (*H) Project

func (h *H) Project() project.Interface

Project returns the clientset for projects.

func (*H) REST

func (h *H) REST() *rest.RESTClient

REST returns a client for generic operations.

func (*H) Route

func (h *H) Route() route.Interface

Route returns the clientset for routing.

func (*H) Runner

func (h *H) Runner(cmd string) *runner.Runner

Runner creates an extended test suite runner and configure RBAC for it and runs cmd in it.

func (*H) Setup

func (h *H) Setup()

Setup configures a *rest.Config using the embedded kubeconfig then sets up a Project for tests to run in.

func (*H) WaitForEndpointReady

func (h *H) WaitForEndpointReady(svc *kubev1.Service, n int, dur time.Duration) error

WaitForEndpointReady until Endpoint for svc is ready, checking n times and sleeping dur between them.

func (*H) WaitForPodPhase

func (h *H) WaitForPodPhase(pod *kubev1.Pod, target kubev1.PodPhase, n int, dur time.Duration) (phase kubev1.PodPhase)

WaitForPodPhase until in target, checking n times and sleeping dur between them. Last known phase is returned.

func (*H) WriteResults

func (h *H) WriteResults(results map[string][]byte)

WriteResults dumps runner results into the ReportDir.

Jump to

Keyboard shortcuts

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