Documentation

Index

Constants

const (
	// NodePublishTimeOut_VolumeID is volume id that will result in NodePublish operation to timeout
	NodePublishTimeOut_VolumeID = "node-publish-timeout"

	// NodeStageTimeOut_VolumeID is a volume id that will result in NodeStage operation to timeout
	NodeStageTimeOut_VolumeID = "node-stage-timeout"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CSIVolume

type CSIVolume struct {
	VolumeHandle    string
	VolumeContext   map[string]string
	Path            string
	DeviceMountPath string
	FSType          string
	MountFlags      []string
}

type Closer

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

func NewCloser

func NewCloser(t *testing.T) *Closer

func (*Closer) Check

func (c *Closer) Check() *Closer

func (*Closer) Close

func (c *Closer) Close() error

type ControllerClient

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

ControllerClient represents a CSI Controller client

func NewControllerClient

func NewControllerClient() *ControllerClient

NewControllerClient returns a ControllerClient

func (*ControllerClient) ControllerGetCapabilities

func (f *ControllerClient) ControllerGetCapabilities(ctx context.Context, in *csipb.ControllerGetCapabilitiesRequest, opts ...grpc.CallOption) (*csipb.ControllerGetCapabilitiesResponse, error)

ControllerGetCapabilities implements csi method

func (*ControllerClient) ControllerPublishVolume

func (f *ControllerClient) ControllerPublishVolume(ctx context.Context, in *csipb.ControllerPublishVolumeRequest, opts ...grpc.CallOption) (*csipb.ControllerPublishVolumeResponse, error)

ControllerPublishVolume implements csi method

func (*ControllerClient) ControllerUnpublishVolume

func (f *ControllerClient) ControllerUnpublishVolume(ctx context.Context, in *csipb.ControllerUnpublishVolumeRequest, opts ...grpc.CallOption) (*csipb.ControllerUnpublishVolumeResponse, error)

ControllerUnpublishVolume implements csi method

func (*ControllerClient) CreateVolume

func (f *ControllerClient) CreateVolume(ctx context.Context, in *csipb.CreateVolumeRequest, opts ...grpc.CallOption) (*csipb.CreateVolumeResponse, error)

CreateVolume implements csi method

func (*ControllerClient) DeleteVolume

func (f *ControllerClient) DeleteVolume(ctx context.Context, in *csipb.DeleteVolumeRequest, opts ...grpc.CallOption) (*csipb.DeleteVolumeResponse, error)

DeleteVolume implements csi method

func (*ControllerClient) GetCapacity

func (f *ControllerClient) GetCapacity(ctx context.Context, in *csipb.GetCapacityRequest, opts ...grpc.CallOption) (*csipb.GetCapacityResponse, error)

GetCapacity implements csi method

func (*ControllerClient) ListVolumes

func (f *ControllerClient) ListVolumes(ctx context.Context, in *csipb.ListVolumesRequest, opts ...grpc.CallOption) (*csipb.ListVolumesResponse, error)

ListVolumes implements csi method

func (*ControllerClient) SetNextCapabilities

func (f *ControllerClient) SetNextCapabilities(caps []*csipb.ControllerServiceCapability)

SetNextCapabilities injects next expected capabilities

func (*ControllerClient) SetNextError

func (f *ControllerClient) SetNextError(err error)

SetNextError injects next expected error

func (*ControllerClient) ValidateVolumeCapabilities

func (f *ControllerClient) ValidateVolumeCapabilities(ctx context.Context, in *csipb.ValidateVolumeCapabilitiesRequest, opts ...grpc.CallOption) (*csipb.ValidateVolumeCapabilitiesResponse, error)

ValidateVolumeCapabilities implements csi method

type IdentityClient

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

IdentityClient is a CSI identity client used for testing

func NewIdentityClient

func NewIdentityClient() *IdentityClient

NewIdentityClient returns a new IdentityClient

func (*IdentityClient) GetPluginCapabilities

func (f *IdentityClient) GetPluginCapabilities(ctx context.Context, in *csipb.GetPluginCapabilitiesRequest, opts ...grpc.CallOption) (*csipb.GetPluginCapabilitiesResponse, error)

GetPluginCapabilities implements csi method

func (*IdentityClient) GetPluginInfo

func (f *IdentityClient) GetPluginInfo(ctx context.Context, in *csipb.GetPluginInfoRequest, opts ...grpc.CallOption) (*csipb.GetPluginInfoResponse, error)

GetPluginInfo returns plugin info

func (*IdentityClient) Probe

func (f *IdentityClient) Probe(ctx context.Context, in *csipb.ProbeRequest, opts ...grpc.CallOption) (*csipb.ProbeResponse, error)

Probe implements csi method

func (*IdentityClient) SetNextError

func (f *IdentityClient) SetNextError(err error)

SetNextError injects expected error

type NodeClient

type NodeClient struct {
	FakeNodeExpansionRequest *csipb.NodeExpandVolumeRequest
	// contains filtered or unexported fields
}

NodeClient returns CSI node client

func NewNodeClient

func NewNodeClient(stageUnstageSet bool) *NodeClient

NewNodeClient returns fake node client

func NewNodeClientWithExpansion

func NewNodeClientWithExpansion(stageUnstageSet bool, expansionSet bool) *NodeClient

func NewNodeClientWithVolumeStats

func NewNodeClientWithVolumeStats(volumeStatsSet bool) *NodeClient

func (*NodeClient) AddNodePublishedVolume

func (f *NodeClient) AddNodePublishedVolume(volID, deviceMountPath string, volumeContext map[string]string)

AddNodePublishedVolume adds specified volume to nodePublishedVolumes

func (*NodeClient) AddNodeStagedVolume

func (f *NodeClient) AddNodeStagedVolume(volID, deviceMountPath string, volumeContext map[string]string)

AddNodeStagedVolume adds specified volume to nodeStagedVolumes

func (*NodeClient) GetNodePublishedVolumes

func (f *NodeClient) GetNodePublishedVolumes() map[string]CSIVolume

GetNodePublishedVolumes returns node published volumes

func (*NodeClient) GetNodeStagedVolumes

func (f *NodeClient) GetNodeStagedVolumes() map[string]CSIVolume

GetNodeStagedVolumes returns node staged volumes

func (*NodeClient) NodeExpandVolume

func (f *NodeClient) NodeExpandVolume(ctx context.Context, req *csipb.NodeExpandVolumeRequest, opts ...grpc.CallOption) (*csipb.NodeExpandVolumeResponse, error)

NodeExpandVolume implements csi method

func (*NodeClient) NodeGetCapabilities

func (f *NodeClient) NodeGetCapabilities(ctx context.Context, in *csipb.NodeGetCapabilitiesRequest, opts ...grpc.CallOption) (*csipb.NodeGetCapabilitiesResponse, error)

NodeGetCapabilities implements csi method

func (*NodeClient) NodeGetInfo

func (f *NodeClient) NodeGetInfo(ctx context.Context, in *csipb.NodeGetInfoRequest, opts ...grpc.CallOption) (*csipb.NodeGetInfoResponse, error)

NodeGetId implements csi method

func (*NodeClient) NodeGetVolumeStats

func (f *NodeClient) NodeGetVolumeStats(ctx context.Context, req *csipb.NodeGetVolumeStatsRequest, opts ...grpc.CallOption) (*csipb.NodeGetVolumeStatsResponse, error)

NodeGetVolumeStats implements csi method

func (*NodeClient) NodePublishVolume

func (f *NodeClient) NodePublishVolume(ctx context.Context, req *csipb.NodePublishVolumeRequest, opts ...grpc.CallOption) (*csipb.NodePublishVolumeResponse, error)

NodePublishVolume implements CSI NodePublishVolume

func (*NodeClient) NodeStageVolume

func (f *NodeClient) NodeStageVolume(ctx context.Context, req *csipb.NodeStageVolumeRequest, opts ...grpc.CallOption) (*csipb.NodeStageVolumeResponse, error)

NodeStagevolume implements csi method

func (*NodeClient) NodeUnpublishVolume

func (f *NodeClient) NodeUnpublishVolume(ctx context.Context, req *csipb.NodeUnpublishVolumeRequest, opts ...grpc.CallOption) (*csipb.NodeUnpublishVolumeResponse, error)

NodeUnpublishVolume implements csi method

func (*NodeClient) NodeUnstageVolume

func (f *NodeClient) NodeUnstageVolume(ctx context.Context, req *csipb.NodeUnstageVolumeRequest, opts ...grpc.CallOption) (*csipb.NodeUnstageVolumeResponse, error)

NodeUnstageVolume implements csi method

func (*NodeClient) SetNextError

func (f *NodeClient) SetNextError(err error)

SetNextError injects next expected error

func (*NodeClient) SetNodeGetInfoResp

func (f *NodeClient) SetNodeGetInfoResp(resp *csipb.NodeGetInfoResponse)

func (*NodeClient) SetNodeVolumeStatsResp

func (f *NodeClient) SetNodeVolumeStatsResp(resp *csipb.NodeGetVolumeStatsResponse)