e2e

package
v0.19.3 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2015 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServiceNodePortRange = util.PortRange{Base: 30000, Size: 2767}

This should match whatever the default/configured range is

Functions

func BadEvents added in v0.16.0

func BadEvents(events []*api.Event) int

Prints the histogram of the events and returns the number of bad events.

func CheckCadvisorHealthOnAllNodes added in v0.11.0

func CheckCadvisorHealthOnAllNodes(c *client.Client, timeout time.Duration)

func ClusterLevelLoggingWithElasticsearch added in v0.14.0

func ClusterLevelLoggingWithElasticsearch(f *Framework)

ClusterLevelLoggingWithElasticsearch is an end to end test for cluster level logging.

func DeleteRC added in v0.13.0

func DeleteRC(c *client.Client, ns, name string) error

Delete a Replication Controller and all pods it spawned

func FailedContainers added in v0.18.2

func FailedContainers(pod *api.Pod) map[string]ContainerFailures

FailedContainers inspects all containers in a pod and returns failure information for containers that have failed or been restarted. A map is returned where the key is the containerID and the value is a struct containing the restart and failure information

func Failf added in v0.11.0

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

func HighLatencyRequests added in v0.17.0

func HighLatencyRequests(c *client.Client, threshold time.Duration, ignoredResources util.StringSet) (int, error)

Prints summary metrics for request types with latency above threshold and returns number of such request types.

func LaunchNetTestPodPerNode added in v0.15.0

func LaunchNetTestPodPerNode(f *Framework, nodes *api.NodeList, name, version string) []string

func Logf added in v0.11.0

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

func NodeSSHHosts added in v0.18.2

func NodeSSHHosts(c *client.Client) ([]string, error)

NodeSSHHosts returns SSH-able host names for all nodes. It returns an error if it can't find an external IP for every node, though it still returns all hosts that it found in that case.

func RunRC added in v0.13.0

func RunRC(config RCConfig) error

RunRC Launches (and verifies correctness) of a Replication Controller and will wait for all pods it spawns to become "Running". It's the caller's responsibility to clean up externally (i.e. use the namespace lifecycle for handling cleanup).

func SSH added in v0.17.0

func SSH(cmd, host, provider string) (string, string, int, error)

SSH synchronously SSHs to a node running on provider and runs cmd. If there is no error performing the SSH, the stdout, stderr, and exit code are returned.

func ScaleRC added in v0.18.2

func ScaleRC(c *client.Client, ns, name string, size uint) error

func ServeImageOrFail added in v0.11.0

func ServeImageOrFail(c *client.Client, test string, image string)

A basic test to check the deployment of an image using a replication controller. The image serves its hostname which is checked for each replica.

Types

type CloudConfig added in v0.15.0

type CloudConfig struct {
	ProjectID         string
	Zone              string
	MasterName        string
	NodeInstanceGroup string
	NumNodes          int
	ClusterTag        string

	Provider cloudprovider.Interface
}

type ContainerFailures added in v0.18.2

type ContainerFailures struct {
	// contains filtered or unexported fields
}

type FifoQueue added in v0.19.0

type FifoQueue QueueItems

func (*FifoQueue) First added in v0.19.0

func (fq *FifoQueue) First() QueueItem

func (*FifoQueue) Last added in v0.19.0

func (fq *FifoQueue) Last() QueueItem

func (FifoQueue) Len added in v0.19.0

func (fq FifoQueue) Len() int

func (*FifoQueue) Pop added in v0.19.0

func (fq *FifoQueue) Pop() QueueItem

func (*FifoQueue) Push added in v0.19.0

func (fq *FifoQueue) Push(elem interface{})

func (*FifoQueue) Reset added in v0.19.0

func (fq *FifoQueue) Reset()

type Framework added in v0.18.2

type Framework struct {
	BaseName string

	Namespace *api.Namespace
	Client    *client.Client
}

Framework supports common operations used by e2e tests; it will keep a client & a namespace for you. Eventual goal is to merge this with integration test framework.

func NewFramework added in v0.18.2

func NewFramework(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) TestContainerOutput added in v0.18.2

func (f *Framework) TestContainerOutput(scenarioName string, pod *api.Pod, expectedOutput []string)

Runs the given pod and verifies that its output matches the desired output.

func (*Framework) WaitForPodRunning added in v0.18.2

func (f *Framework) WaitForPodRunning(podName string) error

WaitForPodRunning waits for the pod to run in the namespace.

type LatencyMetric added in v0.17.0

type LatencyMetric struct {
	Verb     string
	Resource string
	// 0 <= quantile <=1, e.g. 0.95 is 95%tile, 0.5 is median.
	Quantile float64
	Latency  time.Duration
}

LatencyMetrics stores data about request latency at a given quantile broken down by verb (e.g. GET, PUT, LIST) and resource (e.g. pods, services).

func ReadLatencyMetrics added in v0.17.0

func ReadLatencyMetrics(c *client.Client) ([]LatencyMetric, error)

type LatencyMetricByLatency added in v0.18.2

type LatencyMetricByLatency []LatencyMetric

LatencyMetricByLatency implements sort.Interface for []LatencyMetric based on the latency field.

func (LatencyMetricByLatency) Len added in v0.18.2

func (a LatencyMetricByLatency) Len() int

func (LatencyMetricByLatency) Less added in v0.18.2

func (a LatencyMetricByLatency) Less(i, j int) bool

func (LatencyMetricByLatency) Swap added in v0.18.2

func (a LatencyMetricByLatency) Swap(i, j int)

type PodDiff added in v0.18.2

type PodDiff map[string]*podInfo

PodDiff is a map of pod name to podInfos

func Diff added in v0.18.2

func Diff(oldPods []*api.Pod, curPods []*api.Pod) PodDiff

Diff computes a PodDiff given 2 lists of pods.

func (PodDiff) Print added in v0.18.2

func (p PodDiff) Print(ignorePhases util.StringSet)

Print formats and prints the give PodDiff.

type QueueItem added in v0.19.0

type QueueItem struct {
	// contains filtered or unexported fields
}

type QueueItems added in v0.19.0

type QueueItems struct {
	// contains filtered or unexported fields
}

type RCConfig added in v0.19.0

type RCConfig struct {
	Client        *client.Client
	Image         string
	Name          string
	Namespace     string
	PollInterval  int
	PodStatusFile *os.File
	Replicas      int
}

type State added in v0.18.2

type State struct {
	Received map[string]int
}

partially cloned from webserver.go

type TestContextType added in v0.15.0

type TestContextType struct {
	KubeConfig  string
	KubeContext string
	CertDir     string
	Host        string
	RepoRoot    string
	Provider    string
	CloudConfig CloudConfig
	KubectlPath string
	OutputDir   string
	// contains filtered or unexported fields
}

type VolumeTestConfig added in v0.18.2

type VolumeTestConfig struct {
	// contains filtered or unexported fields
}

Configuration of one tests. The test consist of: - server pod - runs serverImage, exports ports[] - client pod - does not need any special configuration

type WebserverTest added in v0.18.2

type WebserverTest struct {
	ServiceName string
	Namespace   string
	Client      *client.Client

	TestId string
	Labels map[string]string
	// contains filtered or unexported fields
}

Simple helper class to avoid too much boilerplate in tests

func NewWebserverTest added in v0.18.2

func NewWebserverTest(client *client.Client, namespace string, serviceName string) *WebserverTest

func (*WebserverTest) BuildServiceSpec added in v0.18.2

func (t *WebserverTest) BuildServiceSpec() *api.Service

Build default config for a service (which can then be changed)

func (*WebserverTest) Cleanup added in v0.18.2

func (t *WebserverTest) Cleanup() []error

func (*WebserverTest) CreatePod added in v0.18.2

func (t *WebserverTest) CreatePod(pod *api.Pod) (*api.Pod, error)

Create a pod, and record it for cleanup

func (*WebserverTest) CreateService added in v0.18.2

func (t *WebserverTest) CreateService(service *api.Service) (*api.Service, error)

Create a service, and record it for cleanup

func (*WebserverTest) CreateWebserverPod added in v0.18.2

func (t *WebserverTest) CreateWebserverPod()

Create a pod with the well-known webserver configuration, and record it for cleanup

func (*WebserverTest) DeleteService added in v0.18.2

func (t *WebserverTest) DeleteService(serviceName string) error

Delete a service, and remove it from the cleanup list

func (*WebserverTest) SequenceNext added in v0.18.2

func (t *WebserverTest) SequenceNext() int

Jump to

Keyboard shortcuts

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