framework

package
v0.0.0-...-bc45f5a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BusyBoxImage = "busybox"
)

Variables

This section is empty.

Functions

func CreateAndWaitPod

func CreateAndWaitPod(kubecli kubernetes.Interface, ns string, pod *v1.Pod, timeout time.Duration) (*v1.Pod, error)

CreateAndWaitPod creates a pod and waits until it is running

func CreateMXJob

func CreateMXJob(mxjob *v1alpha1.MXJob) error

CreateMXJob creates the MXJob to APIServer.

func DeleteAndWaitPod

func DeleteAndWaitPod(kubecli kubernetes.Interface, ns, name string, timeout time.Duration) error

DeleteAndWaitPod deletes a pod and waits util it is completely disappeared.

func NewTestMXJob

func NewTestMXJob(ns, name string, behavior Behavior, servers, workers int32) *v1alpha1.MXJob

NewTestMXJob creates a MXJob for testing purpose.

func WaitForMXJobFailed

func WaitForMXJobFailed(ns, name string) error

WaitForMXJobFailed waits for the MXJob to fail.

func WaitForMXJobFinish

func WaitForMXJobFinish(ns, name string) error

WaitForMXJobFinish waits for the MXJob to finish.

func WaitForMXJobSucceed

func WaitForMXJobSucceed(ns, name string) error

WaitForMXJobSucceed waits for the MXJob to succeed.

Types

type Behavior

type Behavior int

Behavior is the replica behavior of MXJob for testing.

const (
	BehaviorSucceed Behavior = iota
	BehaviorFail
	BehaviorRandomlySucceedOrFail
	BehaviorNotTerminate
	BehaviorSchedulerFail
	BehaviorWorkerFail
	BehaviorServerFail
)

type Framework

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

Framework is a framework for e2e testing.

func New

func New(kubecli kubernetes.Interface, ns, opImage string) *Framework

New creates a Framework.

func (*Framework) Namespace

func (t *Framework) Namespace() string

Namespace returns the namespace of the framework.

func (*Framework) Setup

func (t *Framework) Setup() error

Setup setup the framework.

func (*Framework) Teardown

func (t *Framework) Teardown() error

Teardown cleanup the framework.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL