kubernetes: github.com/iameli/kubernetes/test/e2e Index | Files

package e2e

import "github.com/iameli/kubernetes/test/e2e"

Index

Package Files

addon_update.go apparmor.go autoscaling_utils.go cadvisor.go cluster_logging_es.go cluster_logging_gcl.go cluster_logging_utils.go cluster_size_autoscaling.go cluster_upgrade.go cronjob.go daemon_restart.go daemon_set.go dashboard.go density.go deployment.go disruption.go dns.go dns_autoscaling.go dns_configmap.go e2e.go empty.go empty_dir_wrapper.go etcd_failure.go events.go example_cluster_dns.go example_k8petstore.go examples.go federated-ingress.go federated-namespace.go federated-secret.go federated-service.go federation-apiserver.go federation-authn.go federation-daemonset.go federation-deployment.go federation-event.go federation-replicaset.go federation-util-14.go federation-util.go firewall.go garbage_collector.go generated_clientset.go gke_local_ssd.go gke_node_pools.go ha_master.go horizontal_pod_autoscaling.go ingress.go ingress_utils.go initial_resources.go job.go kibana_logging.go kube_proxy.go kubectl.go kubelet.go kubelet_perf.go limit_range.go load.go logging_soak.go mesos.go monitoring.go namespace.go network_partition.go networking.go networking_perf.go node_problem_detector.go nodeoutofdisk.go opaque_resource.go pd.go persistent_volumes.go petset.go pod_gc.go pods.go portforward.go pre_stop.go proxy.go rc.go reboot.go replica_set.go rescheduler.go resize_nodes.go resource_quota.go restart.go scheduler_predicates.go security_context.go service.go service_accounts.go service_latency.go serviceloadbalancers.go ssh.go third-party.go ubernetes_lite.go util_iperf.go volume_provisioning.go volumes.go

Constants

const (
    ADD    = "ADD"
    DEL    = "DEL"
    UPDATE = "UPDATE"
)
const (
    MinSaturationThreshold     = 2 * time.Minute
    MinPodsPerSecondThroughput = 8
    DensityPollInterval        = 10 * time.Second
)
const (
    DNSdefaultTimeout      = 5 * time.Minute
    ClusterAddonLabelKey   = "k8s-app"
    DNSLabelName           = "kube-dns"
    DNSAutoscalerLabelName = "kube-dns-autoscaler"
)
const (
    MaxRetriesOnFederatedApiserver = 3
    FederatedIngressTimeout        = 120 * time.Second
    FederatedIngressName           = "federated-ingress"
    FederatedIngressServiceName    = "federated-ingress-service"
    FederatedIngressServicePodName = "federated-ingress-service-test-pod"
)
const (
    FederatedSecretTimeout = 60 * time.Second
    MaxRetries             = 3
)
const (
    FederatedServiceTimeout = 60 * time.Second

    FederatedServiceName    = "federated-service"
    FederatedServicePodName = "federated-service-test-pod"

    KubeDNSConfigMapName      = "kube-dns"
    KubeDNSConfigMapNamespace = "kube-system"
)
const (
    FederatedDaemonSetName       = "federated-daemonset"
    FederatedDaemonSetTimeout    = 60 * time.Second
    FederatedDaemonSetMaxRetries = 3
)
const (
    FederationDeploymentName   = "federation-deployment"
    FederatedDeploymentTimeout = 120 * time.Second
)
const (
    FederationReplicaSetName   = "federation-replicaset"
    FederatedReplicaSetTimeout = 120 * time.Second
)
const (
    FederationEventName = "federation-event"
)
const (

    // IP src range from which the GCE L7 performs health checks.
    GCEL7SrcRange = "130.211.0.0/22"
)

Variables

var (
    CronJobGroupVersionResource      = schema.GroupVersionResource{Group: batch.GroupName, Version: "v2alpha1", Resource: "cronjobs"}
    ScheduledJobGroupVersionResource = schema.GroupVersionResource{Group: batch.GroupName, Version: "v2alpha1", Resource: "scheduledjobs"}
    BatchV2Alpha1GroupVersion        = schema.GroupVersion{Group: batch.GroupName, Version: "v2alpha1"}
)
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.
)
var FederatedServiceLabels = map[string]string{
    "foo": "bar",
}
var MaxContainerFailures = 0

Maximum container failures this test tolerates before failing.

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

This should match whatever the default/configured range is

func CheckCadvisorHealthOnAllNodes Uses

func CheckCadvisorHealthOnAllNodes(c clientset.Interface, timeout time.Duration)

func ClusterLevelLoggingWithKibana Uses

func ClusterLevelLoggingWithKibana(f *framework.Framework)

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

func CreateHostPortPods Uses

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

func CreateNamespaces Uses

func CreateNamespaces(f *framework.Framework, namespaceCount int, namePrefix string) ([]*v1.Namespace, error)

func CreateNodeSelectorPods Uses

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

func GetGroupNodes Uses

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

func GroupSize Uses

func GroupSize(group string) (int, error)

func LoadAppArmorProfiles Uses

func LoadAppArmorProfiles(f *framework.Framework)

func NewRestartConfig Uses

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

NewRestartConfig creates a restartDaemonConfig for the given node and daemon.

func Query Uses

func Query(c clientset.Interface, query string) (*influxdb.Response, error)

Query sends a command to the server and returns the Response

func RemoveCleanupAction Uses

func RemoveCleanupAction(p CleanupActionHandle)

RemoveCleanupAction removes a function that was installed by AddCleanupAction.

func ReplicaSetServeImageOrFail Uses

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 Uses

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

func ReserveMemory Uses

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

func ResizeGroup Uses

func ResizeGroup(group string, size int32) error

func RunCleanupActions Uses

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 Uses

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 Uses

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 Uses

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 SkipIfAppArmorNotSupported Uses

func SkipIfAppArmorNotSupported()

func SpreadRCOrFail Uses

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 Uses

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

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

func WaitForClusterSizeFunc Uses

func WaitForClusterSizeFunc(c clientset.Interface, sizeFunc func(int) bool, timeout time.Duration) error

WaitForClusterSize waits until the cluster size matches the given function.

func WaitForGroupSize Uses

func WaitForGroupSize(group string, size int32) error

func WaitForTerminatedContainer Uses

func WaitForTerminatedContainer(f *framework.Framework, pod *v1.Pod, containerName string) error

type CleanupActionHandle Uses

type CleanupActionHandle *int

func AddCleanupAction Uses

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 DNSParamsLinear Uses

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

type DensityTestConfig Uses

type DensityTestConfig struct {
    Configs           []testutils.RunObjectConfig
    ClientSet         clientset.Interface
    InternalClientset internalclientset.Interface
    PollInterval      time.Duration
    PodCount          int

    SecretConfigs []*testutils.SecretConfig
    DaemonConfigs []*testutils.DaemonConfig
    // contains filtered or unexported fields
}

type Foo Uses

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

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

type FooList Uses

type FooList struct {
    metav1.TypeMeta `json:",inline"`
    metav1.ListMeta `json:"metadata,omitempty" description:"standard list metadata; see http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata"`

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

type GCEIngressController Uses

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

GCEIngressController manages implementation details of Ingress on GCE/GKE.

func (*GCEIngressController) Cleanup Uses

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 Uses

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

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

type IPerfResult Uses

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 Uses

func NewIPerf(csvLine string) *IPerfResult

NewIPerf parses an IPerf CSV output line into an IPerfResult.

type IPerfResults Uses

type IPerfResults struct {
    BandwidthMap map[string]int64
}

func (*IPerfResults) Add Uses

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

Add adds a new result to the Results struct.

func (*IPerfResults) ToTSV Uses

func (i *IPerfResults) ToTSV() string

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

type LBCTester Uses

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

LBCTester is an interface used to test loadbalancer controllers.

type LogEntry Uses

type LogEntry struct {
    TextPayload string
}

type NginxIngressController Uses

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

NginxIngressController manages implementation details of Ingress on Nginx.

type PortsByPodName Uses

type PortsByPodName map[string][]int

type PortsByPodUID Uses

type PortsByPodUID map[types.UID][]int

type ResourceConsumer Uses

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 Uses

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

func NewStaticResourceConsumer Uses

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 Uses

func (rc *ResourceConsumer) CleanUp()

func (*ResourceConsumer) ConsumeCPU Uses

func (rc *ResourceConsumer) ConsumeCPU(millicores int)

ConsumeCPU consumes given number of CPU

func (*ResourceConsumer) ConsumeCustomMetric Uses

func (rc *ResourceConsumer) ConsumeCustomMetric(amount int)

ConsumeMem consumes given number of custom metric

func (*ResourceConsumer) ConsumeMem Uses

func (rc *ResourceConsumer) ConsumeMem(megabytes int)

ConsumeMem consumes given number of Mem

func (*ResourceConsumer) EnsureDesiredReplicas Uses

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

func (*ResourceConsumer) GetReplicas Uses

func (rc *ResourceConsumer) GetReplicas() int

func (*ResourceConsumer) WaitForReplicas Uses

func (rc *ResourceConsumer) WaitForReplicas(desiredReplicas int)

type ServiceTestFixture Uses

type ServiceTestFixture struct {
    ServiceName string
    Namespace   string
    Client      clientset.Interface

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

Simple helper class to avoid too much boilerplate in tests

func NewServerTest Uses

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

func (*ServiceTestFixture) BuildServiceSpec Uses

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

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

func (*ServiceTestFixture) Cleanup Uses

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

func (*ServiceTestFixture) CreateService Uses

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

Create a service, and record it for cleanup

func (*ServiceTestFixture) CreateWebserverRC Uses

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

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

func (*ServiceTestFixture) DeleteService Uses

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

Delete a service, and remove it from the cleanup list

type ServiceTestJig Uses

type ServiceTestJig struct {
    ID     string
    Name   string
    Client clientset.Interface
    Labels map[string]string
}

A test jig to help testing.

func NewServiceTestJig Uses

func NewServiceTestJig(client clientset.Interface, name string) *ServiceTestJig

NewServiceTestJig allocates and inits a new ServiceTestJig.

func (*ServiceTestJig) ChangeServiceNodePortOrFail Uses

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

func (*ServiceTestJig) ChangeServiceType Uses

func (j *ServiceTestJig) ChangeServiceType(namespace, name string, newType v1.ServiceType, timeout time.Duration)

func (*ServiceTestJig) CreateTCPServiceOrFail Uses

func (j *ServiceTestJig) CreateTCPServiceOrFail(namespace string, tweak func(svc *v1.Service)) *v1.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 Uses

func (j *ServiceTestJig) CreateTCPServiceWithPort(namespace string, tweak func(svc *v1.Service), port int32) *v1.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 Uses

func (j *ServiceTestJig) CreateUDPServiceOrFail(namespace string, tweak func(svc *v1.Service)) *v1.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 Uses

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

func (*ServiceTestJig) GetNodesNames Uses

func (j *ServiceTestJig) GetNodesNames(maxNodesForTest int) []string

func (*ServiceTestJig) LaunchNetexecPodOnNode Uses

func (j *ServiceTestJig) LaunchNetexecPodOnNode(f *framework.Framework, nodeName, podName string, httpPort, udpPort int32, hostNetwork bool)

func (*ServiceTestJig) RunOrFail Uses

func (j *ServiceTestJig) RunOrFail(namespace string, tweak func(rc *v1.ReplicationController)) *v1.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 Uses

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

func (*ServiceTestJig) TestHTTPHealthCheckNodePort Uses

func (j *ServiceTestJig) TestHTTPHealthCheckNodePort(host string, port int, request string, tries int) (pass, fail int, statusMsg string)

func (*ServiceTestJig) TestNotReachableHTTP Uses

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

func (*ServiceTestJig) TestNotReachableUDP Uses

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

func (*ServiceTestJig) TestReachableHTTP Uses

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

func (*ServiceTestJig) TestReachableUDP Uses

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

func (*ServiceTestJig) UpdateService Uses

func (j *ServiceTestJig) UpdateService(namespace, name string, update func(*v1.Service)) (*v1.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 Uses

func (j *ServiceTestJig) UpdateServiceOrFail(namespace, name string, update func(*v1.Service)) *v1.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 Uses

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

func (*ServiceTestJig) WaitForLoadBalancerOrFail Uses

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

type State Uses

type State struct {
    Received map[string]int
}

partially cloned from webserver.go

type StrSlice Uses

type StrSlice []string

type VolumeTest Uses

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

VolumeTest contains a volumes to mount into a client pod and its expected content.

type VolumeTestConfig Uses

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

Package e2e imports 138 packages (graph). Updated 2017-10-23. Refresh now. Tools for package owners.