e2e

package
v1.4.0-alpha.2....-4dc418c Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2016 License: Apache-2.0 Imports: 123 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ADD    = "ADD"
	DEL    = "DEL"
	UPDATE = "UPDATE"
)
View Source
const (
	MinSaturationThreshold     = 2 * time.Minute
	MinPodsPerSecondThroughput = 8
)
View Source
const (
	MaxRetriesOnFederatedApiserver = 3
	FederatedIngressTimeout        = 120 * time.Second
	FederatedIngressName           = "federated-ingress"
	FederatedIngressServiceName    = "federated-ingress-service"
	FederatedIngressServicePodName = "federated-ingress-service-test-pod"
)
View Source
const (
	FederatedSecretName    = "federated-secret"
	FederatedSecretTimeout = 60 * time.Second
	MaxRetries             = 3
)
View Source
const (
	FederatedServiceTimeout = 60 * time.Second

	FederatedServiceName    = "federated-service"
	FederatedServicePodName = "federated-service-test-pod"
)
View Source
const (
	FederationReplicaSetName   = "federation-replicaset"
	FederatedReplicaSetTimeout = 120 * time.Second
)
View Source
const (
	FederationEventName = "federation-event"
)

Variables

View Source
var (
	KubeAPIQPS            float32 = 20.0
	KubeAPIBurst                  = 30
	DefaultFederationName         = "federation"
	UserAgentName                 = "federation-e2e"
	// We use this to decide how long to wait for our DNS probes to succeed.
	DNSTTL = 180 * time.Second // TODO: make k8s.io/kubernetes/federation/pkg/federation-controller/service.minDnsTtl exported, and import it here.
)
View Source
var (
	ScheduledJobGroupVersionResource = unversioned.GroupVersionResource{Group: batch.GroupName, Version: "v2alpha1", Resource: "scheduledjobs"}
	BatchV2Alpha1GroupVersion        = unversioned.GroupVersion{Group: batch.GroupName, Version: "v2alpha1"}
)
View Source
var FederatedServiceLabels = map[string]string{
	"foo": "bar",
}
View Source
var MaxContainerFailures = 0

Maximum container failures this test tolerates before failing.

View Source
var ServiceNodePortRange = utilnet.PortRange{Base: 30000, Size: 2768}

This should match whatever the default/configured range is

Functions

func CheckCadvisorHealthOnAllNodes

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

func ClusterLevelLoggingWithElasticsearch

func ClusterLevelLoggingWithElasticsearch(f *framework.Framework)

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

func ClusterLevelLoggingWithKibana

func ClusterLevelLoggingWithKibana(f *framework.Framework)

ClusterLevelLoggingWithKibana is an end to end test that checks to see if Kibana is alive.

func CreateHostPortPods

func CreateHostPortPods(f *framework.Framework, id string, replicas int, expectRunning bool)

func CreateNodeSelectorPods

func CreateNodeSelectorPods(f *framework.Framework, id string, replicas int, nodeSelector map[string]string, expectRunning bool)

func ExpectNoError

func ExpectNoError(err error)

func GetGroupNodes

func GetGroupNodes(group string) ([]string, error)

func GroupSize

func GroupSize(group string) (int, error)

func NewRestartConfig

func NewRestartConfig(nodeName, daemonName string, healthzPort int, pollInterval, pollTimeout time.Duration) *restartDaemonConfig

NewRestartConfig creates a restartDaemonConfig for the given node and daemon.

func Query

func Query(c *client.Client, query string) (*influxdb.Response, error)

Query sends a command to the server and returns the Response

func RemoveCleanupAction

func RemoveCleanupAction(p CleanupActionHandle)

RemoveCleanupAction removes a function that was installed by AddCleanupAction.

func ReplicaSetServeImageOrFail

func ReplicaSetServeImageOrFail(f *framework.Framework, test string, image string)

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

func ReserveCpu

func ReserveCpu(f *framework.Framework, id string, replicas, millicores int)

func ReserveMemory

func ReserveMemory(f *framework.Framework, id string, replicas, megabytes int, expectRunning bool)

func ResizeGroup

func ResizeGroup(group string, size int32) 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 RunE2ETests

func RunE2ETests(t *testing.T)

TestE2E checks configuration parameters (specified through flags) and then runs E2E tests using the Ginkgo runner. If a "report directory" is specified, one or more JUnit test reports will be generated in this directory, and cluster logs will also be saved. This function is called on each Ginkgo node in parallel mode.

func RunLogPodsWithSleepOf

func RunLogPodsWithSleepOf(f *framework.Framework, sleep time.Duration, podname string, timeout time.Duration)

RunLogPodsWithSleepOf creates a pod on every node, logs continuously (with "sleep" pauses), and verifies that the log string was produced in each and every pod at least once. The final arg is the timeout for the test to verify all the pods got logs.

func ServeImageOrFail

func ServeImageOrFail(f *framework.Framework, 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.

func SpreadRCOrFail

func SpreadRCOrFail(f *framework.Framework, replicaCount int32, image string)

Check that the pods comprising a replication controller get spread evenly across available zones

func SpreadServiceOrFail

func SpreadServiceOrFail(f *framework.Framework, replicaCount int, image string)

Check that the pods comprising a service get spread evenly across available zones

func WaitForClusterSizeFunc

func WaitForClusterSizeFunc(c *client.Client, sizeFunc func(int) bool, timeout time.Duration) error

WaitForClusterSize waits until the cluster size matches the given function.

func WaitForGroupSize

func WaitForGroupSize(group string, size int32) error

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 DensityTestConfig

type DensityTestConfig struct {
	Configs      []framework.RCConfig
	Client       *client.Client
	ClientSet    internalclientset.Interface
	Namespace    string
	PollInterval time.Duration
	PodCount     int
	Timeout      time.Duration
}

type Foo

type Foo struct {
	unversioned.TypeMeta `json:",inline"`
	api.ObjectMeta       `json:"metadata,omitempty" description:"standard object metadata"`

	SomeField  string `json:"someField"`
	OtherField int    `json:"otherField"`
}

type FooList

type FooList struct {
	unversioned.TypeMeta `json:",inline"`
	unversioned.ListMeta `` /* 134-byte string literal not displayed */

	Items []Foo `json:"items"`
}

type GCEIngressController

type GCEIngressController struct {
	UID string
	// contains filtered or unexported fields
}

GCEIngressController manages implementation details of Ingress on GCE/GKE.

func (*GCEIngressController) Cleanup

func (cont *GCEIngressController) Cleanup(del bool) error

Cleanup cleans up cloud resources. If del is false, it simply reports existing resources without deleting them. It always deletes resources created through it's methods, like staticIP, even if del is false.

type HPAScaleTest

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

HPAScaleTest struct is used by the scale(...) function.

type IPerfResult

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

IPerfResult struct modelling an iperf record.... 20160314154239,172.17.0.3,34152,172.17.0.2,5001,3,0.0-10.0,33843707904,27074774092

func NewIPerf

func NewIPerf(csvLine string) *IPerfResult

NewIPerf parses an IPerf CSV output line into an IPerfResult.

type IPerfResults

type IPerfResults struct {
	BandwidthMap map[string]int64
}

func (*IPerfResults) Add

func (i *IPerfResults) Add(ipr *IPerfResult)

Add adds a new result to the Results struct.

func (*IPerfResults) ToTSV

func (i *IPerfResults) ToTSV() string

ToTSV exports an easily readable tab delimited format of all IPerfResults.

type LBCTester

type LBCTester interface {
	// contains filtered or unexported methods
}

LBCTester is an interface used to test loadbalancer controllers.

type NginxIngressController

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

NginxIngressController manages implementation details of Ingress on Nginx.

type PortsByPodName

type PortsByPodName map[string][]int

type PortsByPodUID

type PortsByPodUID map[types.UID][]int

type ResourceConsumer

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

ResourceConsumer is a tool for testing. It helps create specified usage of CPU or memory (Warning: memory not supported) typical use case: rc.ConsumeCPU(600) // ... check your assumption here rc.ConsumeCPU(300) // ... check your assumption here

func NewDynamicResourceConsumer

func NewDynamicResourceConsumer(name, kind string, replicas, initCPUTotal, initMemoryTotal, initCustomMetric int, cpuLimit, memLimit int64, f *framework.Framework) *ResourceConsumer

func NewStaticResourceConsumer

func NewStaticResourceConsumer(name string, replicas, initCPUTotal, initMemoryTotal, initCustomMetric int, cpuLimit, memLimit int64, f *framework.Framework) *ResourceConsumer

TODO this still defaults to replication controller

func (*ResourceConsumer) CleanUp

func (rc *ResourceConsumer) CleanUp()

func (*ResourceConsumer) ConsumeCPU

func (rc *ResourceConsumer) ConsumeCPU(millicores int)

ConsumeCPU consumes given number of CPU

func (*ResourceConsumer) ConsumeCustomMetric

func (rc *ResourceConsumer) ConsumeCustomMetric(amount int)

ConsumeMem consumes given number of custom metric

func (*ResourceConsumer) ConsumeMem

func (rc *ResourceConsumer) ConsumeMem(megabytes int)

ConsumeMem consumes given number of Mem

func (*ResourceConsumer) EnsureDesiredReplicas

func (rc *ResourceConsumer) EnsureDesiredReplicas(desiredReplicas int, timeout time.Duration)

func (*ResourceConsumer) GetReplicas

func (rc *ResourceConsumer) GetReplicas() int

func (*ResourceConsumer) WaitForReplicas

func (rc *ResourceConsumer) WaitForReplicas(desiredReplicas int)

type ServiceTestFixture

type ServiceTestFixture 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 NewServerTest

func NewServerTest(client *client.Client, namespace string, serviceName string) *ServiceTestFixture

func (*ServiceTestFixture) BuildServiceSpec

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

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

func (*ServiceTestFixture) Cleanup

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

func (*ServiceTestFixture) CreateService

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

Create a service, and record it for cleanup

func (*ServiceTestFixture) CreateWebserverRC

func (t *ServiceTestFixture) CreateWebserverRC(replicas int32) *api.ReplicationController

CreateWebserverRC creates rc-backed pods with the well-known webserver configuration and records it for cleanup.

func (*ServiceTestFixture) DeleteService

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

Delete a service, and remove it from the cleanup list

type ServiceTestJig

type ServiceTestJig struct {
	ID     string
	Name   string
	Client *client.Client
	Labels map[string]string
}

A test jig to help testing.

func NewServiceTestJig

func NewServiceTestJig(client *client.Client, name string) *ServiceTestJig

NewServiceTestJig allocates and inits a new ServiceTestJig.

func (*ServiceTestJig) ChangeServiceNodePortOrFail

func (j *ServiceTestJig) ChangeServiceNodePortOrFail(namespace, name string, initial int) *api.Service

func (*ServiceTestJig) CreateTCPServiceOrFail

func (j *ServiceTestJig) CreateTCPServiceOrFail(namespace string, tweak func(svc *api.Service)) *api.Service

CreateTCPServiceOrFail creates a new TCP Service based on the jig's defaults. Callers can provide a function to tweak the Service object before it is created.

func (*ServiceTestJig) CreateTCPServiceWithPort

func (j *ServiceTestJig) CreateTCPServiceWithPort(namespace string, tweak func(svc *api.Service), port int32) *api.Service

CreateTCPServiceWithPort creates a new TCP Service with given port based on the jig's defaults. Callers can provide a function to tweak the Service object before it is created.

func (*ServiceTestJig) CreateUDPServiceOrFail

func (j *ServiceTestJig) CreateUDPServiceOrFail(namespace string, tweak func(svc *api.Service)) *api.Service

CreateUDPServiceOrFail creates a new UDP Service based on the jig's defaults. Callers can provide a function to tweak the Service object before it is created.

func (*ServiceTestJig) GetHTTPContent

func (j *ServiceTestJig) GetHTTPContent(host string, port int, timeout time.Duration, url string) bytes.Buffer

func (*ServiceTestJig) RunOrFail

func (j *ServiceTestJig) RunOrFail(namespace string, tweak func(rc *api.ReplicationController)) *api.ReplicationController

RunOrFail creates a ReplicationController and Pod(s) and waits for the Pod(s) to be running. Callers can provide a function to tweak the RC object before it is created.

func (*ServiceTestJig) SanityCheckService

func (j *ServiceTestJig) SanityCheckService(svc *api.Service, svcType api.ServiceType)

func (*ServiceTestJig) TestHTTPHealthCheckNodePort

func (j *ServiceTestJig) TestHTTPHealthCheckNodePort(host string, port int, request string, expectedSuccess bool)

func (*ServiceTestJig) TestNotReachableHTTP

func (j *ServiceTestJig) TestNotReachableHTTP(host string, port int, timeout time.Duration)

func (*ServiceTestJig) TestNotReachableUDP

func (j *ServiceTestJig) TestNotReachableUDP(host string, port int, timeout time.Duration)

func (*ServiceTestJig) TestReachableHTTP

func (j *ServiceTestJig) TestReachableHTTP(host string, port int, timeout time.Duration)

func (*ServiceTestJig) TestReachableUDP

func (j *ServiceTestJig) TestReachableUDP(host string, port int, timeout time.Duration)

func (*ServiceTestJig) UpdateService

func (j *ServiceTestJig) UpdateService(namespace, name string, update func(*api.Service)) (*api.Service, error)

UpdateService fetches a service, calls the update function on it, and then attempts to send the updated service. It tries up to 3 times in the face of timeouts and conflicts.

func (*ServiceTestJig) UpdateServiceOrFail

func (j *ServiceTestJig) UpdateServiceOrFail(namespace, name string, update func(*api.Service)) *api.Service

UpdateServiceOrFail fetches a service, calls the update function on it, and then attempts to send the updated service. It tries up to 3 times in the face of timeouts and conflicts.

func (*ServiceTestJig) WaitForLoadBalancerDestroyOrFail

func (j *ServiceTestJig) WaitForLoadBalancerDestroyOrFail(namespace, name string, ip string, port int, timeout time.Duration) *api.Service

func (*ServiceTestJig) WaitForLoadBalancerOrFail

func (j *ServiceTestJig) WaitForLoadBalancerOrFail(namespace, name string, timeout time.Duration) *api.Service

type State

type State struct {
	Received map[string]int
}

partially cloned from webserver.go

type StrSlice

type StrSlice []string

type VolumeTestConfig

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

Directories

Path Synopsis
This is a utility for prometheus pushing functionality.
This is a utility for prometheus pushing functionality.

Jump to

Keyboard shortcuts

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