package
1.8.0
Repository: https://github.com/openkruise/kruise.git
Documentation: pkg.go.dev

# Packages

Package testfiles provides a wrapper around various optional ways of retrieving additional files needed during a test run: - builtin bindata - filesystem access Because it is a is self-contained package, it can be used by test/e2e/framework and test/e2e/manifest without creating a circular dependency.

# Functions

AddCleanupAction installs a function that will be called in the event of the whole test being terminated.
AfterReadingAllFlags makes changes to the context after all flags have been read.
AllNodesReady checks whether all registered nodes are ready.
ConformanceIt is a wrapper function for ginkgo It.
CreatePV creates the PV resource.
CreateServiceSpec creates service spec.
CreateStatefulSetService creates a Headless Service with Name name and Selector set to match labels.
CreateTestingNS should be used by every test, note that we append a common prefix to the provided test name.
DeleteAllStatefulSets deletes all StatefulSet API Objects in Namespace ns.
DumpAllNamespaceInfo is used to dump all namespace info.
DumpDebugInfo dumps debug info.
DumpEventsInNamespace dump events in namespace.
ExpectEqual expects the specified two are the same, otherwise an exception raises.
ExpectNoError checks if "err" is set.
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").
ExpectNoErrorWithRetries checks if "err" is set with retries.
Failf print fail log.
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").
Filter filters nodes in NodeList in place, removing nodes that do not satisfy the given condition.
FilterNodes filters nodes in NodeList in place, removing nodes that do not satisfy the given condition TODO: consider merging with pkg/client/cache.NodeLister.
GetDefaultStorageClassName returns default storageClass or return error.
GetRandomReadySchedulableNode gets a single randomly-selected node which is available for running pods on.
GetReadySchedulableNodes addresses the common use case of getting nodes you can do work on.
GetReadySchedulableNodesOrDie addresses the common use case of getting nodes you can do work on.
IsConditionSetAsExpected returns a wantTrue value if the node has a match to the conditionType, otherwise returns an opposite value of the wantTrue with detailed logging.
IsConditionSetAsExpectedSilent returns a wantTrue value if the node has a match to the conditionType, otherwise returns an opposite value of the wantTrue.
IsNodeConditionSetAsExpected indicate if node is ready.
IsNodeConditionSetAsExpectedSilent indicate if node is ready with silent.
IsNodeConditionUnset indicate if set condition.
IsNodeReady returns true if: 1) it's Ready condition is set to true 2) doesn't have NetworkUnavailable condition set to true.
IsNodeSchedulable returns true if: 1) doesn't have "unschedulable" field set 2) it also returns true from IsNodeReady.
KruiseDescribe is a wrapper function for ginkgo describe.
KruisePDescribe is a wrapper function for ginkgo describe.
KubectlCmd runs the kubectl executable through the wrapper script.
LoadClientset loads config of client set.
LoadConfig loads config.
Logf print info log.
NewDefaultFramework makes a new framework and sets up a BeforeEach/AfterEach for you (you can write additional before/after each functions).
NewFramework makes a new framework and sets up a BeforeEach/AfterEach.
NewKubectlCommand return a KubectlBuilder.
NewStatefulSet creates a new NGINX StatefulSet for testing.
NewStatefulSetPVC returns a PersistentVolumeClaim named name, for testing StatefulSets.
NewStatefulSetScale creates a new StatefulSet scale subresource and returns it.
NewStatefulSetTester creates a StatefulSetTester that uses c to interact with the API server.
RegisterClusterFlags registers flags specific to the cluster e2e test suite.
RegisterCommonFlags registers flags common to all e2e test suites.
RegisterNodeFlags registers flags specific to the node e2e test suite.
RegisterProvider is expected to be called during application init, typically by an init function in a provider package.
RemoveCleanupAction removes a function that was installed by AddCleanupAction.
RestclientConfig loads config.
RunCleanupActions runs all functions installed by AddCleanupAction.
RunHostCmd runs the given cmd in the context of the given pod using `kubectl exec` inside of a shell.
RunHostCmdWithRetries calls RunHostCmd and retries all errors until it succeeds or the specified timeout expires.
RunKubectl is a convenience wrapper over KubectlBuilder.
RunKubectlOrDie is a convenience wrapper over KubectlBuilder.
SetupProviderConfig validates the chosen provider and creates an interface instance for it.
SkipIfNoDefaultStorageClass skips tests if no default SC can be found.
UpdateStatefulSetWithRetries update StatefulSet with retries.
WaitForDefaultServiceAccountInNamespace waits for the default service account to be provisioned the default service account is what is associated with pods when they do not specify a service account as a result, pods are not able to be provisioned in a namespace until the service account is provisioned.
WaitForPodCondition waits until pod satisfied condition.
WaitForPodNameRunningInNamespace waits default amount of time (PodStartTimeout) for the specified pod to become running.
WaitForPodRunningInNamespace waits default amount of time (PodStartTimeout) for the specified pod to become running.
WaitTimeoutForPodRunningInNamespace waits default amount of time.

# Constants

ClaimBindingTimeout indicates how long claims have to become bound.
ClaimDeletingTimeout indicates how long claims have to become deleted.
ClaimProvisionShortTimeout is same as `ClaimProvisionTimeout` to wait for claim to be dynamically provisioned, but shorter.
ClaimProvisionTimeout indicates how long claims have to become dynamically provisioned.
DaemonSetRetryPeriod indicates poll interval for DaemonSet tests.
DaemonSetRetryTimeout indicates timeout interval for DaemonSet operations.
Allow fake NodeImage with no Node related, just for tests.
NamespaceCleanupTimeout indicates: If there are any orphaned namespaces to clean up, this test is running on a long lived cluster.
NodeReadyInitialTimeout indicates how long nodes have to be "ready" when a test begins.
PodDeleteTimeout indicates how long to wait for a pod to be deleted.
PodEventTimeout is how much we wait for a pod event to occur.
PodListTimeout indicates how long to wait for the pod to be listable.
PodReadyBeforeTimeout indicates how long pods have to be "ready" when a test begins.
PodStartShortTimeout is same as `PodStartTimeout` to wait for the pod to be started, but shorter.
PodStartTimeout indicates that initial pod start can be delayed O(minutes) by slow docker pulls TODO: Make this 30 seconds once #4566 is resolved.
Poll indicates how often to Poll pods, nodes and claims.
PVBindingTimeout indicates how long PVs have to become bound.
PVDeletingTimeout indicates how long PVs have to become deleted.
PVReclaimingTimeout indicates how long PVs have to beome reclaimed.
RestartNodeReadyAgainTimeout indicates how long a node is allowed to become "Ready" after it is restarted before the test is considered failed.
RestartPodReadyAgainTimeout indicates how long a pod is allowed to become "running" and "ready" after a node restart before test is considered failed.
ServiceAccountProvisionTimeout indicates a service account provision timeout.
ServiceStartTimeout indicates how long to wait for a service endpoint to be resolvable.
SingleCallTimeout indicates how long to try single API calls (like 'get' or 'list').
StatefulPodTimeout indicates timeout for stateful pods to change state.
StatefulSetPoll indicates poll interval for StatefulSet tests.
StatefulSetTimeout indicates timeout interval for StatefulSet operations.

# Variables

NotReadyTaintTemplate is the taint for when a node doesn't ready.
RunID is a unique identifier of the e2e run.
TestContext defines a context include test settings and global state.
UnreachableTaintTemplate is the taint for when a node becomes unreachable.

# Structs

CloudConfig defines some config.
Framework supports common operations used by e2e tests; it will keep a client & a namespace for you.
KubectlBuilder is used to build, customize and execute a kubectl Command.
NodeTestContextType is part of TestContextType, it is shared by all node e2e test.
NullProvider is the default implementation of the ProviderInterface which doesn't do anything.
Options contains some options.
PodClient defines a convenience method for getting a pod client interface in the framework's namespace.
StatefulSetTester is a struct that contains utility methods for testing StatefulSet related functionality.
TestContextType contains test settings and global state.

# Interfaces

ProviderInterface contains the implementation for certain provider-specific functionality.
TestDataSummary defines a interface to test data summary.

# Type aliases

ClientConfigGetter gets client config.
CreateTestingNSFn defines a function to create test.
EventsLister defines a event listener.
Factory represents the factory pattern.
VerifyStatefulPodFunc is a func that examines a StatefulSetPod.