cri-api: k8s.io/cri-api/pkg/apis/testing Index | Files

package testing

import "k8s.io/cri-api/pkg/apis/testing"

Index

Package Files

fake_image_service.go fake_runtime_service.go utils.go

Variables

var (
    FakeVersion = "0.1.0"

    FakeRuntimeName   = "fakeRuntime"
    FakePodSandboxIPs = []string{"192.168.192.168"}
)

func BuildContainerName Uses

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

func BuildSandboxName Uses

func BuildSandboxName(metadata *runtimeapi.PodSandboxMetadata) string

type FakeContainer Uses

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

    // LinuxResources contains the resources specific to linux containers.
    LinuxResources *runtimeapi.LinuxContainerResources

    // the sandbox id of this container
    SandboxID string
}

type FakeImageService Uses

type FakeImageService struct {
    sync.Mutex

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

    FakeFilesystemUsage []*runtimeapi.FilesystemUsage
    // contains filtered or unexported fields
}

func NewFakeImageService Uses

func NewFakeImageService() *FakeImageService

func (*FakeImageService) AssertImagePulledWithAuth Uses

func (r *FakeImageService) AssertImagePulledWithAuth(t *testing.T, image *runtimeapi.ImageSpec, auth *runtimeapi.AuthConfig, failMsg string)

func (*FakeImageService) ImageFsInfo Uses

func (r *FakeImageService) ImageFsInfo() ([]*runtimeapi.FilesystemUsage, error)

ImageFsInfo returns information of the filesystem that is used to store images.

func (*FakeImageService) ImageStatus Uses

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

func (*FakeImageService) ListImages Uses

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

func (*FakeImageService) PullImage Uses

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

func (*FakeImageService) RemoveImage Uses

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

func (*FakeImageService) SetFakeFilesystemUsage Uses

func (r *FakeImageService) SetFakeFilesystemUsage(usage []*runtimeapi.FilesystemUsage)

func (*FakeImageService) SetFakeImageSize Uses

func (r *FakeImageService) SetFakeImageSize(size uint64)

func (*FakeImageService) SetFakeImages Uses

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

type FakePodSandbox Uses

type FakePodSandbox struct {
    // PodSandboxStatus contains the runtime information for a sandbox.
    runtimeapi.PodSandboxStatus
    // RuntimeHandler is the runtime handler that was issued with the RunPodSandbox request.
    RuntimeHandler string
}

type FakeRuntimeService Uses

type FakeRuntimeService struct {
    sync.Mutex

    Called []string
    Errors map[string][]error

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

func NewFakeRuntimeService Uses

func NewFakeRuntimeService() *FakeRuntimeService

func (*FakeRuntimeService) AssertCalls Uses

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

func (*FakeRuntimeService) Attach Uses

func (r *FakeRuntimeService) Attach(req *runtimeapi.AttachRequest) (*runtimeapi.AttachResponse, error)

func (*FakeRuntimeService) ContainerStats Uses

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

func (*FakeRuntimeService) ContainerStatus Uses

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

func (*FakeRuntimeService) CreateContainer Uses

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

func (*FakeRuntimeService) Exec Uses

func (r *FakeRuntimeService) Exec(*runtimeapi.ExecRequest) (*runtimeapi.ExecResponse, error)

func (*FakeRuntimeService) ExecSync Uses

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

func (*FakeRuntimeService) GetCalls Uses

func (r *FakeRuntimeService) GetCalls() []string

func (*FakeRuntimeService) GetContainerID Uses

func (r *FakeRuntimeService) GetContainerID(sandboxID, name string, attempt uint32) (string, error)

func (*FakeRuntimeService) InjectError Uses

func (r *FakeRuntimeService) InjectError(f string, err error)

func (*FakeRuntimeService) ListContainerStats Uses

func (r *FakeRuntimeService) ListContainerStats(filter *runtimeapi.ContainerStatsFilter) ([]*runtimeapi.ContainerStats, error)

func (*FakeRuntimeService) ListContainers Uses

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

func (*FakeRuntimeService) ListPodSandbox Uses

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

func (*FakeRuntimeService) PodSandboxStatus Uses

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

func (*FakeRuntimeService) PortForward Uses

func (r *FakeRuntimeService) PortForward(*runtimeapi.PortForwardRequest) (*runtimeapi.PortForwardResponse, error)

func (*FakeRuntimeService) RemoveContainer Uses

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

func (*FakeRuntimeService) RemovePodSandbox Uses

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

func (*FakeRuntimeService) ReopenContainerLog Uses

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

func (*FakeRuntimeService) RunPodSandbox Uses

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

func (*FakeRuntimeService) SetFakeContainerStats Uses

func (r *FakeRuntimeService) SetFakeContainerStats(containerStats []*runtimeapi.ContainerStats)

func (*FakeRuntimeService) SetFakeContainers Uses

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

func (*FakeRuntimeService) SetFakeSandboxes Uses

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

func (*FakeRuntimeService) StartContainer Uses

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

func (*FakeRuntimeService) Status Uses

func (r *FakeRuntimeService) Status() (*runtimeapi.RuntimeStatus, error)

func (*FakeRuntimeService) StopContainer Uses

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

func (*FakeRuntimeService) StopPodSandbox Uses

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

func (*FakeRuntimeService) UpdateContainerResources Uses

func (r *FakeRuntimeService) UpdateContainerResources(string, *runtimeapi.LinuxContainerResources) error

func (*FakeRuntimeService) UpdateRuntimeConfig Uses

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

func (*FakeRuntimeService) Version Uses

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

Package testing imports 7 packages (graph) and is imported by 4 packages. Updated 2019-07-11. Refresh now. Tools for package owners.