framework

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2018 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package framework sets up the test framework needed to run the end-to-end tests on Kubernetes.

Index

Constants

View Source
const (
	TestNs = "testing-v1beta1"
)

Variables

This section is empty.

Functions

func ConvertDeployment

func ConvertDeployment(pathToYaml string) (*appsv1beta1.Deployment, error)

ConvertDeployment takes in a path to the YAML file containing the manifest. It converts the file to the Deployment object.

func ConvertHabitat

func ConvertHabitat(pathToYaml string) (*habv1beta1.Habitat, error)

ConvertHabitat takes in a path to the YAML file containing the manifest. It converts the file to the Habitat object.

func ConvertSecret

func ConvertSecret(pathToYaml string) (*v1.Secret, error)

ConvertSecret takes in a path to the YAML file containing the manifest. It converts the file to the Secret object.

func ConvertService

func ConvertService(pathToYaml string) (*v1.Service, error)

ConvertService takes in a path to the YAML file containing the manifest. It converts the file to the Service object.

func QueryService

func QueryService(url string) (string, error)

QueryService makes an HTTP GET request to `url` and returns the body.

Types

type Framework

type Framework struct {
	Image      string
	KubeClient kubernetes.Interface
	Client     habclient.HabitatInterface
	ExternalIP string
}

func Setup

func Setup(image, kubeconfig, externalIP string) (*Framework, error)

Setup sets up the test framework.

func (*Framework) CreateHabitat

func (f *Framework) CreateHabitat(habitat *habv1beta1.Habitat) error

CreateHabitat creates a Habitat.

func (*Framework) DeleteHabitat

func (f *Framework) DeleteHabitat(habitatName string) error

DeleteHabitat deletes a Habitat as a user would.

func (*Framework) DeleteService

func (f *Framework) DeleteService(service string) error

DeleteService delete a Kubernetes service provided.

func (*Framework) GetLoadBalancerIP

func (f *Framework) GetLoadBalancerIP(serviceName string) (string, error)

GetLoadBalancerIP waits for Load Balancer IP to become available and returns it

func (*Framework) WaitForEndpoints

func (f *Framework) WaitForEndpoints(habitatName string) error

func (*Framework) WaitForResources

func (f *Framework) WaitForResources(labelName, habitatName string, numPods int) error

WaitForResources waits until numPods are in the "Running" state. We wait for pods, because those take the longest to create. Waiting for anything else would be already testing.

Jump to

Keyboard shortcuts

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