Documentation ¶
Index ¶
- Constants
- Variables
- func CheckCadvisorHealthOnAllNodes(c clientset.Interface, timeout time.Duration)
- func ClusterLevelLoggingWithKibana(f *framework.Framework)
- func CreateHostPortPods(f *framework.Framework, id string, replicas int, expectRunning bool)
- func CreateNamespaces(f *framework.Framework, namespaceCount int, namePrefix string) ([]*api.Namespace, error)
- func CreateNodeSelectorPods(f *framework.Framework, id string, replicas int, ...)
- func ExpectNoError(err error)
- func GetGroupNodes(group string) ([]string, error)
- func GroupSize(group string) (int, error)
- func NewRestartConfig(nodeName, daemonName string, healthzPort int, ...) *restartDaemonConfig
- func Query(c clientset.Interface, query string) (*influxdb.Response, error)
- func RemoveCleanupAction(p CleanupActionHandle)
- func ReplicaSetServeImageOrFail(f *framework.Framework, test string, image string)
- func ReserveCpu(f *framework.Framework, id string, replicas, millicores int)
- func ReserveMemory(f *framework.Framework, id string, replicas, megabytes int, expectRunning bool)
- func ResizeGroup(group string, size int32) error
- func RunCleanupActions()
- func RunE2ETests(t *testing.T)
- func RunLogPodsWithSleepOf(f *framework.Framework, sleep time.Duration, podname string, ...)
- func ServeImageOrFail(f *framework.Framework, test string, image string)
- func SpreadRCOrFail(f *framework.Framework, replicaCount int32, image string)
- func SpreadServiceOrFail(f *framework.Framework, replicaCount int, image string)
- func WaitForClusterSizeFunc(c clientset.Interface, sizeFunc func(int) bool, timeout time.Duration) error
- func WaitForGroupSize(group string, size int32) error
- type CleanupActionHandle
- type DNSParamsLinear
- type DensityTestConfig
- type Foo
- type FooList
- type GCEIngressController
- type HPAScaleTest
- type IPerfResult
- type IPerfResults
- type LBCTester
- type LogEntry
- type NginxIngressController
- type PortsByPodName
- type PortsByPodUID
- type ResourceConsumer
- func (rc *ResourceConsumer) CleanUp()
- func (rc *ResourceConsumer) ConsumeCPU(millicores int)
- func (rc *ResourceConsumer) ConsumeCustomMetric(amount int)
- func (rc *ResourceConsumer) ConsumeMem(megabytes int)
- func (rc *ResourceConsumer) EnsureDesiredReplicas(desiredReplicas int, timeout time.Duration)
- func (rc *ResourceConsumer) GetReplicas() int
- func (rc *ResourceConsumer) WaitForReplicas(desiredReplicas int)
- type ServiceTestFixture
- func (t *ServiceTestFixture) BuildServiceSpec() *api.Service
- func (t *ServiceTestFixture) Cleanup() []error
- func (t *ServiceTestFixture) CreateService(service *api.Service) (*api.Service, error)
- func (t *ServiceTestFixture) CreateWebserverRC(replicas int32) *api.ReplicationController
- func (t *ServiceTestFixture) DeleteService(serviceName string) error
- type ServiceTestJig
- func (j *ServiceTestJig) ChangeServiceNodePortOrFail(namespace, name string, initial int) *api.Service
- func (j *ServiceTestJig) ChangeServiceType(namespace, name string, newType api.ServiceType, timeout time.Duration)
- func (j *ServiceTestJig) CreateTCPServiceOrFail(namespace string, tweak func(svc *api.Service)) *api.Service
- func (j *ServiceTestJig) CreateTCPServiceWithPort(namespace string, tweak func(svc *api.Service), port int32) *api.Service
- func (j *ServiceTestJig) CreateUDPServiceOrFail(namespace string, tweak func(svc *api.Service)) *api.Service
- func (j *ServiceTestJig) GetHTTPContent(host string, port int, timeout time.Duration, url string) bytes.Buffer
- func (j *ServiceTestJig) RunOrFail(namespace string, tweak func(rc *api.ReplicationController)) *api.ReplicationController
- func (j *ServiceTestJig) SanityCheckService(svc *api.Service, svcType api.ServiceType)
- func (j *ServiceTestJig) TestHTTPHealthCheckNodePort(host string, port int, request string, tries int) (pass, fail int, statusMsg string)
- func (j *ServiceTestJig) TestNotReachableHTTP(host string, port int, timeout time.Duration)
- func (j *ServiceTestJig) TestNotReachableUDP(host string, port int, timeout time.Duration)
- func (j *ServiceTestJig) TestReachableHTTP(host string, port int, timeout time.Duration)
- func (j *ServiceTestJig) TestReachableUDP(host string, port int, timeout time.Duration)
- func (j *ServiceTestJig) UpdateService(namespace, name string, update func(*api.Service)) (*api.Service, error)
- func (j *ServiceTestJig) UpdateServiceOrFail(namespace, name string, update func(*api.Service)) *api.Service
- func (j *ServiceTestJig) WaitForLoadBalancerDestroyOrFail(namespace, name string, ip string, port int, timeout time.Duration) *api.Service
- func (j *ServiceTestJig) WaitForLoadBalancerOrFail(namespace, name string, timeout time.Duration) *api.Service
- type State
- type StrSlice
- type VolumeTestConfig
Constants ¶
const ( ADD = "ADD" DEL = "DEL" UPDATE = "UPDATE" )
const ( MinSaturationThreshold = 2 * time.Minute MinPodsPerSecondThroughput = 8 DensityPollInterval = 10 * time.Second )
const ( DNSdefaultTimeout = 5 * time.Minute DNSNamespace = "kube-system" ClusterAddonLabelKey = "k8s-app" KubeDNSLabelName = "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"
)
Variables ¶
var ( CronJobGroupVersionResource = unversioned.GroupVersionResource{Group: batch.GroupName, Version: "v2alpha1", Resource: "cronjobs"} ScheduledJobGroupVersionResource = unversioned.GroupVersionResource{Group: batch.GroupName, Version: "v2alpha1", Resource: "scheduledjobs"} BatchV2Alpha1GroupVersion = unversioned.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
Functions ¶
func CheckCadvisorHealthOnAllNodes ¶ added in v0.13.1
func ClusterLevelLoggingWithKibana ¶ added in v1.0.0
ClusterLevelLoggingWithKibana is an end to end test that checks to see if Kibana is alive.
func CreateHostPortPods ¶ added in v1.3.0
func CreateNamespaces ¶ added in v1.5.1
func CreateNodeSelectorPods ¶ added in v1.3.0
func ExpectNoError ¶ added in v1.3.0
func ExpectNoError(err error)
func GetGroupNodes ¶ added in v1.3.0
func NewRestartConfig ¶ added in v1.2.3
func NewRestartConfig(nodeName, daemonName string, healthzPort int, pollInterval, pollTimeout time.Duration) *restartDaemonConfig
NewRestartConfig creates a restartDaemonConfig for the given node and daemon.
func RemoveCleanupAction ¶ added in v1.2.3
func RemoveCleanupAction(p CleanupActionHandle)
RemoveCleanupAction removes a function that was installed by AddCleanupAction.
func ReplicaSetServeImageOrFail ¶ added in v1.2.3
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 ¶ added in v1.2.3
func ReserveMemory ¶ added in v1.2.3
func ResizeGroup ¶ added in v1.3.0
func RunCleanupActions ¶ added in v1.2.3
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 ¶
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 ¶ added in v1.5.1
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 ¶ added in v0.13.1
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 ¶ added in v1.2.3
Check that the pods comprising a replication controller get spread evenly across available zones
func SpreadServiceOrFail ¶ added in v1.2.3
Check that the pods comprising a service get spread evenly across available zones
func WaitForClusterSizeFunc ¶ added in v1.3.0
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 ¶ added in v1.3.0
Types ¶
type CleanupActionHandle ¶ added in v1.2.3
type CleanupActionHandle *int
func AddCleanupAction ¶ added in v1.2.3
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 ¶ added in v1.5.1
type DNSParamsLinear struct {
// contains filtered or unexported fields
}
type DensityTestConfig ¶ added in v1.4.2
type Foo ¶ added in v1.3.0
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 ¶ added in v1.3.0
type FooList struct { unversioned.TypeMeta `json:",inline"` unversioned.ListMeta `` /* 134-byte string literal not displayed */ Items []Foo `json:"items"` }
type GCEIngressController ¶ added in v1.3.0
type GCEIngressController struct { UID string // contains filtered or unexported fields }
GCEIngressController manages implementation details of Ingress on GCE/GKE.
func (*GCEIngressController) Cleanup ¶ added in v1.3.0
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 ¶ added in v1.2.3
type HPAScaleTest struct {
// contains filtered or unexported fields
}
HPAScaleTest struct is used by the scale(...) function.
type IPerfResult ¶ added in v1.3.0
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 ¶ added in v1.3.0
func NewIPerf(csvLine string) *IPerfResult
NewIPerf parses an IPerf CSV output line into an IPerfResult.
type IPerfResults ¶ added in v1.3.0
func (*IPerfResults) Add ¶ added in v1.3.0
func (i *IPerfResults) Add(ipr *IPerfResult)
Add adds a new result to the Results struct.
func (*IPerfResults) ToTSV ¶ added in v1.3.0
func (i *IPerfResults) ToTSV() string
ToTSV exports an easily readable tab delimited format of all IPerfResults.
type LBCTester ¶ added in v1.2.3
type LBCTester interface {
// contains filtered or unexported methods
}
LBCTester is an interface used to test loadbalancer controllers.
type NginxIngressController ¶ added in v1.4.2
type NginxIngressController struct {
// contains filtered or unexported fields
}
NginxIngressController manages implementation details of Ingress on Nginx.
type PortsByPodName ¶ added in v1.2.3
type PortsByPodUID ¶ added in v1.2.3
type ResourceConsumer ¶ added in v1.2.3
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 ¶ added in v1.2.3
func NewStaticResourceConsumer ¶ added in v1.2.3
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 ¶ added in v1.2.3
func (rc *ResourceConsumer) CleanUp()
func (*ResourceConsumer) ConsumeCPU ¶ added in v1.2.3
func (rc *ResourceConsumer) ConsumeCPU(millicores int)
ConsumeCPU consumes given number of CPU
func (*ResourceConsumer) ConsumeCustomMetric ¶ added in v1.2.3
func (rc *ResourceConsumer) ConsumeCustomMetric(amount int)
ConsumeMem consumes given number of custom metric
func (*ResourceConsumer) ConsumeMem ¶ added in v1.2.3
func (rc *ResourceConsumer) ConsumeMem(megabytes int)
ConsumeMem consumes given number of Mem
func (*ResourceConsumer) EnsureDesiredReplicas ¶ added in v1.2.3
func (rc *ResourceConsumer) EnsureDesiredReplicas(desiredReplicas int, timeout time.Duration)
func (*ResourceConsumer) GetReplicas ¶ added in v1.2.3
func (rc *ResourceConsumer) GetReplicas() int
func (*ResourceConsumer) WaitForReplicas ¶ added in v1.2.3
func (rc *ResourceConsumer) WaitForReplicas(desiredReplicas int)
type ServiceTestFixture ¶ added in v1.2.3
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 ¶ added in v1.2.3
func NewServerTest(client clientset.Interface, namespace string, serviceName string) *ServiceTestFixture
func (*ServiceTestFixture) BuildServiceSpec ¶ added in v1.2.3
func (t *ServiceTestFixture) BuildServiceSpec() *api.Service
Build default config for a service (which can then be changed)
func (*ServiceTestFixture) Cleanup ¶ added in v1.2.3
func (t *ServiceTestFixture) Cleanup() []error
func (*ServiceTestFixture) CreateService ¶ added in v1.2.3
Create a service, and record it for cleanup
func (*ServiceTestFixture) CreateWebserverRC ¶ added in v1.2.3
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 ¶ added in v1.2.3
func (t *ServiceTestFixture) DeleteService(serviceName string) error
Delete a service, and remove it from the cleanup list
type ServiceTestJig ¶ added in v1.2.3
type ServiceTestJig struct { ID string Name string Client clientset.Interface Labels map[string]string }
A test jig to help testing.
func NewServiceTestJig ¶ added in v1.2.3
func NewServiceTestJig(client clientset.Interface, name string) *ServiceTestJig
NewServiceTestJig allocates and inits a new ServiceTestJig.
func (*ServiceTestJig) ChangeServiceNodePortOrFail ¶ added in v1.2.3
func (j *ServiceTestJig) ChangeServiceNodePortOrFail(namespace, name string, initial int) *api.Service
func (*ServiceTestJig) ChangeServiceType ¶ added in v1.5.1
func (j *ServiceTestJig) ChangeServiceType(namespace, name string, newType api.ServiceType, timeout time.Duration)
func (*ServiceTestJig) CreateTCPServiceOrFail ¶ added in v1.2.3
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 ¶ added in v1.4.2
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 ¶ added in v1.2.3
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 ¶ added in v1.4.2
func (*ServiceTestJig) RunOrFail ¶ added in v1.2.3
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 ¶ added in v1.2.3
func (j *ServiceTestJig) SanityCheckService(svc *api.Service, svcType api.ServiceType)
func (*ServiceTestJig) TestHTTPHealthCheckNodePort ¶ added in v1.4.2
func (*ServiceTestJig) TestNotReachableHTTP ¶ added in v1.2.3
func (j *ServiceTestJig) TestNotReachableHTTP(host string, port int, timeout time.Duration)
func (*ServiceTestJig) TestNotReachableUDP ¶ added in v1.2.3
func (j *ServiceTestJig) TestNotReachableUDP(host string, port int, timeout time.Duration)
func (*ServiceTestJig) TestReachableHTTP ¶ added in v1.2.3
func (j *ServiceTestJig) TestReachableHTTP(host string, port int, timeout time.Duration)
func (*ServiceTestJig) TestReachableUDP ¶ added in v1.2.3
func (j *ServiceTestJig) TestReachableUDP(host string, port int, timeout time.Duration)
func (*ServiceTestJig) UpdateService ¶ added in v1.2.3
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 ¶ added in v1.2.3
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 ¶ added in v1.2.3
func (*ServiceTestJig) WaitForLoadBalancerOrFail ¶ added in v1.2.3
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
Source Files ¶
- addon_update.go
- autoscaling_utils.go
- batch_v1_jobs.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
- garbage_collector.go
- generated_clientset.go
- gke_local_ssd.go
- gke_node_pools.go
- google_compute.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