Documentation ¶
Index ¶
- Constants
- func AwaitUntil(opMsg string, doOperation DoOperationFunc, checkResult CheckResultFunc) interface{}
- func Errorf(format string, args ...interface{})
- func ExpectNoError(err error, explain ...interface{})
- func ExpectNoErrorWithOffset(offset int, err error, explain ...interface{})
- func Failf(format string, args ...interface{})
- func FailfWithOffset(offset int, format string, args ...interface{})
- func IsTransientError(err error, opMsg string) bool
- func Logf(format string, args ...interface{})
- func NoopCheckResult(interface{}) (bool, error)
- func ParseFlags()
- func RemoveCleanupAction(p CleanupActionHandle)
- func RunCleanupActions()
- func Skipf(format string, args ...interface{})
- type CheckResultFunc
- type CleanupActionHandle
- type ClusterIndex
- type DoOperationFunc
- type ExecOptions
- type Framework
- func (f *Framework) AddNamespacesToDelete(namespaces ...*v1.Namespace)
- func (f *Framework) AfterEach()
- func (f *Framework) BeforeEach()
- func (f *Framework) DeleteService(cluster ClusterIndex, serviceName string)
- func (f *Framework) ExecWithOptions(options ExecOptions, index ClusterIndex) (string, string, error)
- func (f *Framework) NewNetShootDeployment(cluster ClusterIndex) *v1.PodList
- func (f *Framework) NewNginxDeployment(cluster ClusterIndex) *v1.PodList
- func (f *Framework) NewNginxService(cluster ClusterIndex) *corev1.Service
- type Options
- type PatchFunc
- type PatchStringValue
- type ServiceType
- type TestContextType
Constants ¶
const ( SubmarinerEngine = "submariner-engine" GatewayLabel = "submariner.io/gateway" )
const ( // Polling interval while trying to create objects PollInterval = 100 * time.Millisecond )
Variables ¶
This section is empty.
Functions ¶
func AwaitUntil ¶
func AwaitUntil(opMsg string, doOperation DoOperationFunc, checkResult CheckResultFunc) interface{}
AwaitUntil periodically performs the given operation until the given CheckResultFunc returns true, an error, or a timeout is reached.
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 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 IsTransientError ¶
identify API errors which could be considered transient/recoverable due to server state.
func NoopCheckResult ¶
func ParseFlags ¶
func ParseFlags()
func RemoveCleanupAction ¶
func RemoveCleanupAction(p CleanupActionHandle)
RemoveCleanupAction removes a function that was installed by AddCleanupAction.
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.
Types ¶
type CheckResultFunc ¶
type CleanupActionHandle ¶
type CleanupActionHandle *int
CleanupActionHandle is an integer pointer type for handling cleanup action
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 DoOperationFunc ¶
type DoOperationFunc func() (interface{}, error)
type ExecOptions ¶
type ExecOptions struct { Command []string Namespace string PodName string ContainerName string Stdin io.Reader CaptureStdout bool CaptureStderr bool // If false, whitespace in std{err,out} will be removed. PreserveWhitespace bool }
ExecOptions passed to ExecWithOptions
type Framework ¶
type Framework struct { BaseName string // Set together with creating the ClientSet and the namespace. // Guaranteed to be unique in the cluster even when running the same // test multiple times in parallel. UniqueName string ClusterClients []*kubeclientset.Clientset SkipNamespaceCreation bool // Whether to skip creating a namespace Namespace string // Every test has a namespace at least unless creation is skipped // configuration for framework's client Options Options // contains filtered or unexported fields }
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 ¶
NewFramework creates a test framework.
func (*Framework) AddNamespacesToDelete ¶
func (*Framework) AfterEach ¶
func (f *Framework) AfterEach()
AfterEach deletes the namespace, after reading its events.
func (*Framework) BeforeEach ¶
func (f *Framework) BeforeEach()
func (*Framework) DeleteService ¶
func (f *Framework) DeleteService(cluster ClusterIndex, serviceName string)
func (*Framework) ExecWithOptions ¶
func (f *Framework) ExecWithOptions(options ExecOptions, index ClusterIndex) (string, string, error)
ExecWithOptions executes a command in the specified container, returning stdout, stderr and error. `options` allowed for additional parameters to be passed. ExecWithOptions executes a command in the specified container, returning stdout, stderr and error. `options` allowed for additional parameters to be passed.
func (*Framework) NewNetShootDeployment ¶
func (f *Framework) NewNetShootDeployment(cluster ClusterIndex) *v1.PodList
func (*Framework) NewNginxDeployment ¶
func (f *Framework) NewNginxDeployment(cluster ClusterIndex) *v1.PodList
func (*Framework) NewNginxService ¶
func (f *Framework) NewNginxService(cluster ClusterIndex) *corev1.Service
type Options ¶
type Options struct { ClientQPS float32 ClientBurst int GroupVersion *schema.GroupVersion }
Options is a struct for managing test framework options.
type PatchStringValue ¶
type ServiceType ¶
type ServiceType int
type TestContextType ¶
type TestContextType struct { KubeConfig string KubeContexts contextArray ReportDir string ReportPrefix string SubmarinerNamespace string }
var TestContext *TestContextType = &TestContextType{}