testing

package
v1.6.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FakeRuntimeName  = "fakeRuntime"
	FakePodSandboxIP = "192.168.192.168"
)

Functions

func BuildContainerName

func BuildContainerName(metadata *runtimeapi.ContainerMetadata, sandboxID string) string

func BuildSandboxName

func BuildSandboxName(metadata *runtimeapi.PodSandboxMetadata) string

Types

type FakeContainer

type FakeContainer struct {
	// ContainerStatus contains the runtime information for a container.
	runtimeapi.ContainerStatus

	// the sandbox id of this container
	SandboxID string
}

type FakeImageService

type FakeImageService struct {
	sync.Mutex

	FakeImageSize uint64
	Called        []string
	Images        map[string]*runtimeapi.Image
}

func NewFakeImageService

func NewFakeImageService() *FakeImageService

func (*FakeImageService) ImageStatus

func (r *FakeImageService) ImageStatus(image *runtimeapi.ImageSpec) (*runtimeapi.Image, error)

func (*FakeImageService) ListImages

func (r *FakeImageService) ListImages(filter *runtimeapi.ImageFilter) ([]*runtimeapi.Image, error)

func (*FakeImageService) PullImage

func (r *FakeImageService) PullImage(image *runtimeapi.ImageSpec, auth *runtimeapi.AuthConfig) (string, error)

func (*FakeImageService) RemoveImage

func (r *FakeImageService) RemoveImage(image *runtimeapi.ImageSpec) error

func (*FakeImageService) SetFakeImageSize added in v1.5.1

func (r *FakeImageService) SetFakeImageSize(size uint64)

func (*FakeImageService) SetFakeImages

func (r *FakeImageService) SetFakeImages(images []string)

type FakePodSandbox

type FakePodSandbox struct {
	// PodSandboxStatus contains the runtime information for a sandbox.
	runtimeapi.PodSandboxStatus
}

type FakeRuntimeService

type FakeRuntimeService struct {
	sync.Mutex

	Called []string

	FakeStatus *runtimeapi.RuntimeStatus
	Containers map[string]*FakeContainer
	Sandboxes  map[string]*FakePodSandbox
}

func NewFakeRuntimeService

func NewFakeRuntimeService() *FakeRuntimeService

func (*FakeRuntimeService) AssertCalls added in v1.5.1

func (r *FakeRuntimeService) AssertCalls(calls []string) error

func (*FakeRuntimeService) Attach added in v1.5.1

func (*FakeRuntimeService) ContainerStatus

func (r *FakeRuntimeService) ContainerStatus(containerID string) (*runtimeapi.ContainerStatus, error)

func (*FakeRuntimeService) CreateContainer

func (r *FakeRuntimeService) CreateContainer(podSandboxID string, config *runtimeapi.ContainerConfig, sandboxConfig *runtimeapi.PodSandboxConfig) (string, error)

func (*FakeRuntimeService) Exec

func (*FakeRuntimeService) ExecSync added in v1.5.1

func (r *FakeRuntimeService) ExecSync(containerID string, cmd []string, timeout time.Duration) (stdout []byte, stderr []byte, err error)

func (*FakeRuntimeService) ListContainers

func (r *FakeRuntimeService) ListContainers(filter *runtimeapi.ContainerFilter) ([]*runtimeapi.Container, error)

func (*FakeRuntimeService) ListPodSandbox

func (r *FakeRuntimeService) ListPodSandbox(filter *runtimeapi.PodSandboxFilter) ([]*runtimeapi.PodSandbox, error)

func (*FakeRuntimeService) PodSandboxStatus

func (r *FakeRuntimeService) PodSandboxStatus(podSandboxID string) (*runtimeapi.PodSandboxStatus, error)

func (*FakeRuntimeService) PortForward added in v1.5.1

func (*FakeRuntimeService) RemoveContainer

func (r *FakeRuntimeService) RemoveContainer(containerID string) error

func (*FakeRuntimeService) RemovePodSandbox

func (r *FakeRuntimeService) RemovePodSandbox(podSandboxID string) error

func (*FakeRuntimeService) RunPodSandbox added in v1.5.1

func (r *FakeRuntimeService) RunPodSandbox(config *runtimeapi.PodSandboxConfig) (string, error)

func (*FakeRuntimeService) SetFakeContainers

func (r *FakeRuntimeService) SetFakeContainers(containers []*FakeContainer)

func (*FakeRuntimeService) SetFakeSandboxes

func (r *FakeRuntimeService) SetFakeSandboxes(sandboxes []*FakePodSandbox)

func (*FakeRuntimeService) StartContainer

func (r *FakeRuntimeService) StartContainer(containerID string) error

func (*FakeRuntimeService) Status added in v1.5.1

func (*FakeRuntimeService) StopContainer

func (r *FakeRuntimeService) StopContainer(containerID string, timeout int64) error

func (*FakeRuntimeService) StopPodSandbox

func (r *FakeRuntimeService) StopPodSandbox(podSandboxID string) error

func (*FakeRuntimeService) UpdateRuntimeConfig added in v1.5.1

func (r *FakeRuntimeService) UpdateRuntimeConfig(runtimeCOnfig *runtimeapi.RuntimeConfig) error

func (*FakeRuntimeService) Version

func (r *FakeRuntimeService) Version(apiVersion string) (*runtimeapi.VersionResponse, error)

Jump to

Keyboard shortcuts

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