Documentation ¶
Index ¶
- Constants
- Variables
- func AddLabelsToNode(c clientset.Interface, nodeName string, labels map[string]string) error
- func AddOrUpdateLabelOnNode(c clientset.Interface, nodeName string, labelKey, labelValue string)
- func AddOrUpdateTaintOnNode(c clientset.Interface, nodeName string, taint v1.Taint)
- func ExpectNoError(err error, explain ...interface{})
- func ExpectNoErrorWithOffset(offset int, err error, explain ...interface{})
- func ExpectNodeHasLabel(c clientset.Interface, nodeName string, labelKey string, labelValue string)
- func ExpectNodeHasTaint(c clientset.Interface, nodeName string, taint *v1.Taint)
- func Failf(format string, args ...interface{})
- func FailfWithOffset(offset int, format string, args ...interface{})
- func GetJob(c clientset.Interface, ns, name string) (*batch.Job, error)
- func GetJobPods(c clientset.Interface, ns, jobName string) (*v1.PodList, error)
- func GetNodesOrDie(c clientset.Interface) *v1.NodeList
- func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition)
- func GetPodConditionFromList(conditions []v1.PodCondition, conditionType v1.PodConditionType) (int, *v1.PodCondition)
- func GetPodLogs(c clientset.Interface, namespace, podName, containerName string) (string, error)
- func GetPodsScheduled(pods *v1.PodList) (scheduledPods, notScheduledPods []v1.Pod)
- func IsMasterNode(nodeName string) bool
- func KubectlCmd(args ...string) *exec.Cmd
- func ListSchedulableNodes(c clientset.Interface) []v1.Node
- func Logf(format string, args ...interface{})
- func NodeHasTaint(c clientset.Interface, nodeName string, taint *v1.Taint) (bool, error)
- func RemoveLabelOffNode(c clientset.Interface, nodeName string, labelKey string)
- func RemoveTaintOffNode(c clientset.Interface, nodeName string, taint v1.Taint)
- func TaintExists(taints []v1.Taint, taintToFind *v1.Taint) bool
- func VerifyLabelsRemoved(c clientset.Interface, nodeName string, labelKeys []string) error
- func VerifyThatTaintIsGone(c clientset.Interface, nodeName string, taint *v1.Taint)
- func WaitForPodNameRunningInNamespace(c clientset.Interface, podName, namespace string) error
- func WaitForPodNoLongerRunningInNamespace(c clientset.Interface, podName, namespace string) error
- func WaitForPodNotPending(c clientset.Interface, ns, podName string) error
- func WaitForPodRunningInNamespace(c clientset.Interface, pod *v1.Pod) error
- func WaitForStableCluster(c clientset.Interface) int
- func WaitTimeoutForPodNoLongerRunningInNamespace(c clientset.Interface, podName, namespace string, timeout time.Duration) error
- func WaitTimeoutForPodNotPending(c clientset.Interface, ns, podName string, timeout time.Duration) error
- func WaitTimeoutForPodRunningInNamespace(c clientset.Interface, podName, namespace string, timeout time.Duration) error
- type Action
- type Framework
- func (f *Framework) AfterEach()
- func (f *Framework) BeforeEach()
- func (f *Framework) CreateFirmament() error
- func (f *Framework) CreatePoseidon() error
- func (f *Framework) DeleteDeploymentIfExist(nsName string, deploymentName string) error
- func (f *Framework) DeletePoseidonClusterRole(clusterRole string, nsName string) error
- func (f *Framework) DeleteService(nsName string, serviceName string) error
- func (f *Framework) FetchLogsForAllPodsInNamespace(nsName string)
- func (f *Framework) FetchLogsFromFirmament(nsName string)
- func (f *Framework) FetchLogsFromPoseidon(nsName string)
- func (f *Framework) KubectlExecCreate(manifestPath string) (string, string, error)
- func (f *Framework) ListPodsInNamespace(ns string)
- func (f *Framework) LogPodsWithOptionalLabels(ns string, match map[string]string, ...)
- func (f *Framework) ObserveEventAfterAction(eventPredicate func(*v1.Event) bool, action Action) (bool, error)
- func (f *Framework) WaitForAllJobPodsRunning(jobName string, parallelism int32) error
- func (f *Framework) WaitForDeploymentComplete(d *extensions.Deployment) error
- func (f *Framework) WaitForDeploymentDelete(d *extensions.Deployment) error
- func (f *Framework) WaitForJobDelete(job *batchv1.Job) error
- func (f *Framework) WaitForPodNoLongerRunning(podName string) error
- func (f *Framework) WaitForPodNotFound(podName string, timeout time.Duration) error
- func (f *Framework) WaitForPodRunning(podName string) error
- func (f *Framework) WaitForPodRunningSlow(podName string) error
- func (f *Framework) WaitForReadyReplicaSet(name string) error
- func (f *Framework) WaitForReplicaSetDelete(replicaSet *extensions.ReplicaSet) error
- func (f *Framework) WaitForReplicaSetTargetSpecReplicas(replicaSet *extensions.ReplicaSet, targetReplicaNum int32) error
- func (f *Framework) WaitForSchedulerAfterAction(action Action, ns, podName string, expectSuccess bool)
- type FrameworkOptions
Constants ¶
const ( // How long to wait for a job to finish. JobTimeout = 15 * time.Minute // Job selector name JobSelectorKey = "name" )
const ( // How long to wait for the pod to be listable PodListTimeout = time.Minute // Initial pod start can be delayed O(minutes) by slow docker pulls // TODO: Make this 30 seconds once #4566 is resolved. PodStartTimeout = 5 * time.Minute // If there are any orphaned namespaces to clean up, this test is running // on a long lived cluster. A long wait here is preferably to spurious test // failures caused by leaked resources from a previous test run. NamespaceCleanupTimeout = 15 * time.Minute // How long to wait for a service endpoint to be resolvable. ServiceStartTimeout = 1 * time.Minute // How often to Poll pods, nodes and claims. Poll = 2 * time.Second // service accounts are provisioned after namespace creation // a service account is required to support pod creation in a namespace as part of admission control ServiceAccountProvisionTimeout = 2 * time.Minute // How long to try single API calls (like 'get' or 'list'). Used to prevent // transient failures from failing tests. // TODO: client should not apply this timeout to Watch calls. Increased from 30s until that is fixed. SingleCallTimeout = 5 * time.Minute // How long nodes have to be "ready" when a test begins. They should already // be "ready" before the test starts, so this is small. NodeReadyInitialTimeout = 20 * time.Second // How long pods have to be "ready" when a test begins. PodReadyBeforeTimeout = 5 * time.Minute ServiceRespondingTimeout = 2 * time.Minute EndpointRegisterTimeout = time.Minute // How long claims have to become dynamically provisioned ClaimProvisionTimeout = 5 * time.Minute // How long claims have to become bound ClaimBindingTimeout = 3 * time.Minute // How long claims have to become deleted ClaimDeletingTimeout = 3 * time.Minute // How long PVs have to beome reclaimed PVReclaimingTimeout = 3 * time.Minute // How long PVs have to become bound PVBindingTimeout = 3 * time.Minute // How long PVs have to become deleted PVDeletingTimeout = 3 * time.Minute // How long a node is allowed to become "Ready" after it is restarted before // the test is considered failed. RestartNodeReadyAgainTimeout = 5 * time.Minute // How long a pod is allowed to become "running" and "ready" after a node // restart before test is considered failed. RestartPodReadyAgainTimeout = 5 * time.Minute DefaultPodDeletionTimeout = 3 * time.Minute )
Variables ¶
var ( BusyBoxImage = "busybox" // Label allocated to the image puller static pod that runs on each node // before e2es. ImagePullerLabels = map[string]string{"name": "e2e-image-puller"} )
Functions ¶
func AddLabelsToNode ¶
func AddOrUpdateLabelOnNode ¶
func AddOrUpdateTaintOnNode ¶
func ExpectNoError ¶
func ExpectNoError(err error, explain ...interface{})
func ExpectNoErrorWithOffset ¶
ExpectNoErrorWithOffset checks if "err" is set, and if so, fails assertion while logging the error at "offset" levels above its caller (for example, for call chain f -> g -> ExpectNoErrorWithOffset(1, ...) error would be logged for "f").
func ExpectNodeHasLabel ¶
func ExpectNodeHasTaint ¶
func FailfWithOffset ¶
FailfWithOffset calls "Fail" and logs the error at "offset" levels above its caller (for example, for call chain f -> g -> FailfWithOffset(1, ...) error would be logged for "f").
func GetJob ¶
GetJob uses c to get the Job in namespace ns named name. If the returned error is nil, the returned Job is valid.
func GetJobPods ¶
GetJobPods returns a list of Pods belonging to a Job.
func GetNodesOrDie ¶
GetMasterAndWorkerNodesOrDie will return a list masters and schedulable worker nodes
func GetPodCondition ¶
func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition)
GetPodCondition extracts the provided condition from the given status and returns that. Returns nil and -1 if the condition is not present, and the index of the located condition.
func GetPodConditionFromList ¶
func GetPodConditionFromList(conditions []v1.PodCondition, conditionType v1.PodConditionType) (int, *v1.PodCondition)
GetPodConditionFromList extracts the provided condition from the given list of condition and returns the index of the condition and the condition. Returns -1 and nil if the condition is not present.
func GetPodLogs ¶
func GetPodsScheduled ¶
GetPodsScheduled returns a number of currently scheduled and not scheduled Pods.
func IsMasterNode ¶
IsMasterNode returns true if its a master node or false otherwise.
func KubectlCmd ¶
KubectlCmd runs the kubectl executable through the wrapper script.
func ListSchedulableNodes ¶
ListSchedulabelNodes get an slice of nodes that are schedulable
func NodeHasTaint ¶
func RemoveLabelOffNode ¶
RemoveLabelOffNode is for cleaning up labels temporarily added to node, won't fail if target label doesn't exist or has been removed.
func RemoveTaintOffNode ¶
func TaintExists ¶
TaintExists checks if the given taint exists in list of taints. Returns true if exists false otherwise.
func VerifyLabelsRemoved ¶
VerifyLabelsRemoved checks if Node for given nodeName does not have any of labels from labelKeys. Return non-nil error if it does.
func VerifyThatTaintIsGone ¶
func WaitForPodNameRunningInNamespace ¶
Waits default amount of time (PodStartTimeout) for the specified pod to become running. Returns an error if timeout occurs first, or pod goes in to failed state.
func WaitForPodNoLongerRunningInNamespace ¶
Waits default amount of time (DefaultPodDeletionTimeout) for the specified pod to stop running. Returns an error if timeout occurs first.
func WaitForPodNotPending ¶
WaitForPodNotPending returns an error if it took too long for the pod to go out of pending state. The resourceVersion is used when Watching object changes, it tells since when we care about changes to the pod.
func WaitForPodRunningInNamespace ¶
Waits default amount of time (PodStartTimeout) for the specified pod to become running. Returns an error if timeout occurs first, or pod goes in to failed state.
func WaitForStableCluster ¶
WaitForStableCluster waits until all existing pods are scheduled and returns their amount.
func WaitTimeoutForPodNotPending ¶
func WaitTimeoutForPodNotPending(c clientset.Interface, ns, podName string, timeout time.Duration) error
WaitTimeoutForPodNotPending returns an error if it took too long for the pod to go out of pending state. The resourceVersion is used when Watching object changes, it tells since when we care about changes to the pod.
Types ¶
type Framework ¶
type Framework struct { BaseName string ClientSet clientset.Interface Namespace *v1.Namespace TestingNS string Options FrameworkOptions }
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 NewDefaultFramework ¶
NewDefaultFramework makes a new framework and sets up a BeforeEach/AfterEach for you (you can write additional before/after each functions).
func NewFramework ¶
func NewFramework(baseName string, options FrameworkOptions) *Framework
NewFramework makes a new framework and sets up a BeforeEach/AfterEach
func (*Framework) AfterEach ¶
func (f *Framework) AfterEach()
AfterEach deletes the namespace, after reading its events.
func (*Framework) BeforeEach ¶
func (f *Framework) BeforeEach()
BeforeEach gets a client and makes a namespace.
func (*Framework) CreateFirmament ¶
CreateFirmament create firmament deployment
func (*Framework) CreatePoseidon ¶
CreatePoseidon create firmament deployment
func (*Framework) DeleteDeploymentIfExist ¶
DeleteDeploymentIfExist deletes a deployment if it exists
func (*Framework) DeletePoseidonClusterRole ¶
DeletePoseidonClusterRole deletes a cluster role and role binding
func (*Framework) DeleteService ¶
DeleteService deletes a service
func (*Framework) FetchLogsForAllPodsInNamespace ¶
FetchLogsForAllPodsInNamespace will fetch logs from all the pods in the namespace This can be called after each test is run
func (*Framework) FetchLogsFromFirmament ¶
FetchLogsFromPoseidon will get the Poseidon and firmament deplyment logs
func (*Framework) FetchLogsFromPoseidon ¶
FetchLogsFromPoseidon will get the Poseidon and firmament deplyment logs
func (*Framework) KubectlExecCreate ¶
func (*Framework) ListPodsInNamespace ¶
ListPodsInNamespace will list all the pods in a given namespaces
func (*Framework) LogPodsWithOptionalLabels ¶
func (*Framework) ObserveEventAfterAction ¶
func (f *Framework) ObserveEventAfterAction(eventPredicate func(*v1.Event) bool, action Action) (bool, error)
Returns true if an event matching the predicate was emitted from the system after performing the supplied action.
func (*Framework) WaitForAllJobPodsRunning ¶
WaitForAllJobPodsRunning wait for all pods for the Job named JobName in namespace ns to become Running. Only use when pods will run for a long time, or it will be racy.
func (*Framework) WaitForDeploymentComplete ¶
func (f *Framework) WaitForDeploymentComplete(d *extensions.Deployment) error
WaitForDeploymentComplete waits for the deployment to complete, and don't check if rolling update strategy is broken.
func (*Framework) WaitForDeploymentDelete ¶
func (f *Framework) WaitForDeploymentDelete(d *extensions.Deployment) error
WaitForDeploymentDelete waits for the Deployment to be removed
func (*Framework) WaitForJobDelete ¶
WaitForJobDelete waits for job to be removed
func (*Framework) WaitForPodNoLongerRunning ¶
WaitForPodNoLongerRunning waits for the pod to no longer be running in the namespace, for either success or failure.
func (*Framework) WaitForPodNotFound ¶
WaitForPodNotFound waits for the pod to be completely terminated (not "Get-able").
func (*Framework) WaitForPodRunning ¶
WaitForPodRunning waits for the pod to run in the namespace.
func (*Framework) WaitForPodRunningSlow ¶
WaitForPodRunningSlow waits for the pod to run in the namespace. It has a longer timeout then WaitForPodRunning (util.slowPodStartTimeout).
func (*Framework) WaitForReadyReplicaSet ¶
WaitForReadyReplicaSet waits until the replicaset has all of its replicas ready.
func (*Framework) WaitForReplicaSetDelete ¶
func (f *Framework) WaitForReplicaSetDelete(replicaSet *extensions.ReplicaSet) error
WaitForReplicaSetDelete waits for the ReplicateSet to be removed
func (*Framework) WaitForReplicaSetTargetSpecReplicas ¶
func (f *Framework) WaitForReplicaSetTargetSpecReplicas(replicaSet *extensions.ReplicaSet, targetReplicaNum int32) error
WaitForReplicaSetTargetSpecReplicas waits for .spec.replicas of a RS to equal targetReplicaNum
type FrameworkOptions ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package ginkgowrapper wraps Ginkgo Fail and Skip functions to panic with structured data instead of a constant string.
|
Package ginkgowrapper wraps Ginkgo Fail and Skip functions to panic with structured data instead of a constant string. |