testsuites

package
v0.0.0-...-074adba Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VolumePVCKind     = "PersistentVolumeClaim"
	APIVersionv1beta1 = "v1beta1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DataSource

type DataSource struct {
	Name string
}

type DynamicallyProvisionedCmdVolumeTest

type DynamicallyProvisionedCmdVolumeTest struct {
	CSIDriver              driver.DynamicPVTestDriver
	Pods                   []PodDetails
	StorageClassParameters map[string]string
}

DynamicallyProvisionedCmdVolumeTest will provision required StorageClass(es), PVC(s) and Pod(s) Waiting for the PV provisioner to create a new PV Testing if the Pod(s) Cmd is run with a 0 exit code

func (*DynamicallyProvisionedCmdVolumeTest) Run

type DynamicallyProvisionedCollocatedPodTest

type DynamicallyProvisionedCollocatedPodTest struct {
	CSIDriver              driver.DynamicPVTestDriver
	Pods                   []PodDetails
	ColocatePods           bool
	StorageClassParameters map[string]string
}

DynamicallyProvisionedCollocatedPodTest will provision required StorageClass(es), PVC(s) and Pod(s) Waiting for the PV provisioner to create a new PV Testing if multiple Pod(s) can write simultaneously

func (*DynamicallyProvisionedCollocatedPodTest) Run

type DynamicallyProvisionedDeletePodTest

type DynamicallyProvisionedDeletePodTest struct {
	CSIDriver              driver.DynamicPVTestDriver
	Pod                    PodDetails
	PodCheck               *PodExecCheck
	StorageClassParameters map[string]string
}

DynamicallyProvisionedDeletePodTest will provision required StorageClass and Deployment Testing if the Pod can write and read to mounted volumes Deleting a pod, and again testing if the Pod can write and read to mounted volumes

func (*DynamicallyProvisionedDeletePodTest) Run

type DynamicallyProvisionedInlineVolumeTest

type DynamicallyProvisionedInlineVolumeTest struct {
	CSIDriver    driver.DynamicPVTestDriver
	Pods         []PodDetails
	Server       string
	Share        string
	MountOptions string
	ReadOnly     bool
}

DynamicallyProvisionedInlineVolumeTest will provision required server, share Waiting for the PV provisioner to create an inline volume Testing if the Pod(s) Cmd is run with a 0 exit code

func (*DynamicallyProvisionedInlineVolumeTest) Run

type DynamicallyProvisionedPodWithMultiplePVsTest

type DynamicallyProvisionedPodWithMultiplePVsTest struct {
	CSIDriver              driver.DynamicPVTestDriver
	Pods                   []PodDetails
	StorageClassParameters map[string]string
}

DynamicallyProvisionedPodWithMultiplePVsTest will provision one pod with multiple PVs Waiting for the PV provisioner to create a new PV Testing if the Pod(s) Cmd is run with a 0 exit code

func (*DynamicallyProvisionedPodWithMultiplePVsTest) Run

type DynamicallyProvisionedReadOnlyVolumeTest

type DynamicallyProvisionedReadOnlyVolumeTest struct {
	CSIDriver              driver.DynamicPVTestDriver
	Pods                   []PodDetails
	StorageClassParameters map[string]string
}

DynamicallyProvisionedReadOnlyVolumeTest will provision required StorageClass(es), PVC(s) and Pod(s) Waiting for the PV provisioner to create a new PV Testing that the Pod(s) cannot write to the volume when mounted

func (*DynamicallyProvisionedReadOnlyVolumeTest) Run

type DynamicallyProvisionedReclaimPolicyTest

type DynamicallyProvisionedReclaimPolicyTest struct {
	CSIDriver              driver.DynamicPVTestDriver
	Volumes                []VolumeDetails
	ControllerServer       nfs.ControllerServer
	StorageClassParameters map[string]string
}

DynamicallyProvisionedReclaimPolicyTest will provision required PV(s) and PVC(s) Testing the correct behavior for different reclaimPolicies

func (*DynamicallyProvisionedReclaimPolicyTest) Run

type DynamicallyProvisionedVolumeSubpathTester

type DynamicallyProvisionedVolumeSubpathTester struct {
	CSIDriver              driver.DynamicPVTestDriver
	Pods                   []PodDetails
	StorageClassParameters map[string]string
}

DynamicallyProvisionedCmdVolumeTest will provision required StorageClass(es), PVC(s) and Pod(s) Waiting for the PV provisioner to create a new PV Testing if the Pod(s) Cmd is run with a 0 exit code

func (*DynamicallyProvisionedVolumeSubpathTester) Run

type PodDetails

type PodDetails struct {
	Cmd     string
	Volumes []VolumeDetails
}

func (*PodDetails) SetupDeployment

func (pod *PodDetails) SetupDeployment(ctx context.Context, client clientset.Interface, namespace *v1.Namespace, csiDriver driver.DynamicPVTestDriver, storageClassParameters map[string]string) (*TestDeployment, []func(ctx context.Context))

func (*PodDetails) SetupWithCSIInlineVolumes

func (pod *PodDetails) SetupWithCSIInlineVolumes(client clientset.Interface, namespace *v1.Namespace, server, share, mountOptions string, readOnly bool) (*TestPod, []func())

func (*PodDetails) SetupWithDynamicMultipleVolumes

func (pod *PodDetails) SetupWithDynamicMultipleVolumes(ctx context.Context, client clientset.Interface, namespace *v1.Namespace, csiDriver driver.DynamicPVTestDriver, storageClassParameters map[string]string) (*TestPod, []func(ctx context.Context))

SetupWithDynamicMultipleVolumes each pod will be mounted with multiple volumes

func (*PodDetails) SetupWithDynamicVolumes

func (pod *PodDetails) SetupWithDynamicVolumes(ctx context.Context, client clientset.Interface, namespace *v1.Namespace, csiDriver driver.DynamicPVTestDriver, storageClassParameters map[string]string) (*TestPod, []func(ctx context.Context))

func (*PodDetails) SetupWithDynamicVolumesWithSubpath

func (pod *PodDetails) SetupWithDynamicVolumesWithSubpath(ctx context.Context, client clientset.Interface, namespace *v1.Namespace, csiDriver driver.DynamicPVTestDriver, storageClassParameters map[string]string) (*TestPod, []func(ctx context.Context))

type PodExecCheck

type PodExecCheck struct {
	Cmd            []string
	ExpectedString string
}

type TestDeployment

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

func NewTestDeployment

func NewTestDeployment(c clientset.Interface, ns *v1.Namespace, command string, pvc *v1.PersistentVolumeClaim, volumeName, mountPath string, readOnly bool) *TestDeployment

func (*TestDeployment) Cleanup

func (t *TestDeployment) Cleanup(ctx context.Context)

func (*TestDeployment) Create

func (t *TestDeployment) Create(ctx context.Context)

func (*TestDeployment) DeletePodAndWait

func (t *TestDeployment) DeletePodAndWait(ctx context.Context)

func (*TestDeployment) Logs

func (t *TestDeployment) Logs(ctx context.Context) ([]byte, error)

func (*TestDeployment) PollForStringInPodsExec

func (t *TestDeployment) PollForStringInPodsExec(command []string, expectedString string)

func (*TestDeployment) WaitForPodReady

func (t *TestDeployment) WaitForPodReady(ctx context.Context)

type TestPersistentVolumeClaim

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

func NewTestPersistentVolumeClaim

func NewTestPersistentVolumeClaim(c clientset.Interface, ns *v1.Namespace, claimSize string, volumeMode VolumeMode, sc *storagev1.StorageClass) *TestPersistentVolumeClaim

func NewTestPersistentVolumeClaimWithDataSource

func NewTestPersistentVolumeClaimWithDataSource(c clientset.Interface, ns *v1.Namespace, claimSize string, volumeMode VolumeMode, sc *storagev1.StorageClass, dataSource *v1.TypedLocalObjectReference) *TestPersistentVolumeClaim

func (*TestPersistentVolumeClaim) Cleanup

func (t *TestPersistentVolumeClaim) Cleanup(ctx context.Context)

func (*TestPersistentVolumeClaim) Create

func (t *TestPersistentVolumeClaim) Create(ctx context.Context)

func (*TestPersistentVolumeClaim) DeleteBackingVolume

func (t *TestPersistentVolumeClaim) DeleteBackingVolume(cs *nfs.ControllerServer)

func (*TestPersistentVolumeClaim) DeleteBoundPersistentVolume

func (t *TestPersistentVolumeClaim) DeleteBoundPersistentVolume(ctx context.Context)

func (*TestPersistentVolumeClaim) ReclaimPolicy

func (*TestPersistentVolumeClaim) ValidateProvisionedPersistentVolume

func (t *TestPersistentVolumeClaim) ValidateProvisionedPersistentVolume(ctx context.Context)

func (*TestPersistentVolumeClaim) WaitForBound

func (*TestPersistentVolumeClaim) WaitForPersistentVolumePhase

func (t *TestPersistentVolumeClaim) WaitForPersistentVolumePhase(ctx context.Context, phase v1.PersistentVolumePhase)

type TestPod

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

func NewTestPod

func NewTestPod(c clientset.Interface, ns *v1.Namespace, command string) *TestPod

func (*TestPod) Cleanup

func (t *TestPod) Cleanup(ctx context.Context)

func (*TestPod) Create

func (t *TestPod) Create(ctx context.Context)

func (*TestPod) Logs

func (t *TestPod) Logs(ctx context.Context) ([]byte, error)

func (*TestPod) SetNodeSelector

func (t *TestPod) SetNodeSelector(nodeSelector map[string]string)

func (*TestPod) SetupCSIInlineVolume

func (t *TestPod) SetupCSIInlineVolume(name, mountPath, server, share, mountOptions string, readOnly bool)

func (*TestPod) SetupRawBlockVolume

func (t *TestPod) SetupRawBlockVolume(pvc *v1.PersistentVolumeClaim, name, devicePath string)

func (*TestPod) SetupVolume

func (t *TestPod) SetupVolume(pvc *v1.PersistentVolumeClaim, name, mountPath string, readOnly bool)

func (*TestPod) SetupVolumeMountWithSubpath

func (t *TestPod) SetupVolumeMountWithSubpath(pvc *v1.PersistentVolumeClaim, name, mountPath string, subpath string, readOnly bool)

func (*TestPod) WaitForFailure

func (t *TestPod) WaitForFailure(ctx context.Context)

func (*TestPod) WaitForRunning

func (t *TestPod) WaitForRunning(ctx context.Context)

func (*TestPod) WaitForSuccess

func (t *TestPod) WaitForSuccess(ctx context.Context)

type TestStorageClass

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

func (*TestStorageClass) Cleanup

func (t *TestStorageClass) Cleanup(ctx context.Context)

func (*TestStorageClass) Create

type VolumeDetails

type VolumeDetails struct {
	VolumeType            string
	FSType                string
	Encrypted             bool
	MountOptions          []string
	ClaimSize             string
	ReclaimPolicy         *v1.PersistentVolumeReclaimPolicy
	VolumeBindingMode     *storagev1.VolumeBindingMode
	AllowedTopologyValues []string
	VolumeMode            VolumeMode
	VolumeMount           VolumeMountDetails
	VolumeDevice          VolumeDeviceDetails
	// Optional, used with pre-provisioned volumes
	VolumeID string
	// Optional, used with PVCs created from snapshots
	DataSource         *DataSource
	ShareName          string
	NodeStageSecretRef string
}

func (*VolumeDetails) SetupDynamicPersistentVolumeClaim

func (volume *VolumeDetails) SetupDynamicPersistentVolumeClaim(ctx context.Context, client clientset.Interface, namespace *v1.Namespace, csiDriver driver.DynamicPVTestDriver, storageClassParameters map[string]string) (*TestPersistentVolumeClaim, []func(ctx context.Context))

type VolumeDeviceDetails

type VolumeDeviceDetails struct {
	NameGenerate string
	DevicePath   string
}

type VolumeMode

type VolumeMode int
const (
	FileSystem VolumeMode = iota
	Block
)

type VolumeMountDetails

type VolumeMountDetails struct {
	NameGenerate      string
	MountPathGenerate string
	ReadOnly          bool
}

Jump to

Keyboard shortcuts

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