testsuites

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VolumeSnapshotKind = "VolumeSnapshot"
	VolumePVCKind      = "PersistentVolumeClaim"
	APIVersionv1beta1  = "v1beta1"
	SnapshotAPIVersion = "snapshot.storage.k8s.io/" + APIVersionv1beta1
)

Variables

View Source
var (
	SnapshotAPIGroup = "snapshot.storage.k8s.io"
)

Functions

func ListNodeNames added in v1.5.0

func ListNodeNames(c clientset.Interface) []string

Types

type DataSource

type DataSource struct {
	Kind string
	Name string
}

type DynamicallyProvisionedAzureDiskDetach added in v0.9.0

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

DynamicallyProvisionedAzureDiskDetach will provision required StorageClass(es), PVC(s) and Pod(s) Waiting for the PV provisioner to create azuredisk delete Pods Testing if disk is in unattached state

func (*DynamicallyProvisionedAzureDiskDetach) Run added in v0.9.0

type DynamicallyProvisionedAzureDiskWithTag added in v0.8.0

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

DynamicallyProvisionedAzureDiskWithTag will provision required StorageClass(es), PVC(s) and Pod(s) Waiting for the PV provisioner to create azuredisk Testing if azuredisk contains tag

func (*DynamicallyProvisionedAzureDiskWithTag) Run added in v0.8.0

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
}

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 DynamicallyProvisionedInvalidMountOptions added in v0.6.0

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

DynamicallyProvisionedInvalidMountOptions will provision a storage class with invalid mount options Testing if the Pod(s) Cmd is run with a 0 exit code

func (*DynamicallyProvisionedInvalidMountOptions) Run added in v0.6.0

type DynamicallyProvisionedPodWithMultiplePVsTest added in v0.8.0

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

DynamicallyProvisionedPodWithMultiplePVsTest 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 (*DynamicallyProvisionedPodWithMultiplePVsTest) Run added in v0.8.0

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
	Azuredisk              azuredisk.CSIDriver
	StorageClassParameters map[string]string
}

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

func (*DynamicallyProvisionedReclaimPolicyTest) Run

type DynamicallyProvisionedResizeVolumeTest added in v0.8.0

type DynamicallyProvisionedResizeVolumeTest struct {
	CSIDriver              driver.DynamicPVTestDriver
	StorageClassParameters map[string]string
	Pod                    PodDetails
	Volume                 VolumeDetails
}

DynamicallyProvisionedResizeVolumeTest will provision required StorageClass(es), PVC(s) Waiting for the PV provisioner to resize the PV Testing if the PV is resized successfully.

func (*DynamicallyProvisionedResizeVolumeTest) Run added in v0.8.0

type DynamicallyProvisionedStatefulSetTest added in v0.9.0

type DynamicallyProvisionedStatefulSetTest struct {
	CSIDriver driver.DynamicPVTestDriver
	Pod       PodDetails
	PodCheck  *PodExecCheck
}

DynamicallyProvisionedStatefulSetTest will provision required StorageClass and StatefulSet 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 (*DynamicallyProvisionedStatefulSetTest) Run added in v0.9.0

type DynamicallyProvisionedVolumeCloningTest added in v0.5.0

type DynamicallyProvisionedVolumeCloningTest struct {
	CSIDriver              driver.DynamicPVTestDriver
	Pod                    PodDetails
	PodWithClonedVolume    PodDetails
	ClonedVolumeSize       string
	StorageClassParameters map[string]string
}

DynamicallyProvisionedVolumeCloningTest will provision required StorageClass(es), PVC(s) and Pod(s) ClonedVolumeSize optional for when testing for cloned volume with different size to the original volume

func (*DynamicallyProvisionedVolumeCloningTest) Run added in v0.5.0

type DynamicallyProvisionedVolumeSnapshotTest added in v0.5.0

type DynamicallyProvisionedVolumeSnapshotTest struct {
	CSIDriver              driver.PVTestDriver
	Pod                    PodDetails
	ShouldOverwrite        bool
	PodOverwrite           PodDetails
	PodWithSnapshot        PodDetails
	StorageClassParameters map[string]string
}

DynamicallyProvisionedVolumeSnapshotTest will provision required StorageClass(es),VolumeSnapshotClass(es), PVC(s) and Pod(s) Waiting for the PV provisioner to create a new PV Testing if the Pod(s) can write and read to mounted volumes Create a snapshot, validate the data is still on the disk, and then write and read to it again And finally delete the snapshot This test only supports a single volume

func (*DynamicallyProvisionedVolumeSnapshotTest) Run added in v0.5.0

type DynamicallyProvisionedVolumeSubpathTester added in v1.5.0

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 added in v1.5.0

type PodDetails

type PodDetails struct {
	Cmd       string
	Volumes   []VolumeDetails
	IsWindows bool
	UseCMD    bool
}

func (*PodDetails) SetupDeployment

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

func (*PodDetails) SetupStatefulset added in v0.9.0

func (pod *PodDetails) SetupStatefulset(client clientset.Interface, namespace *v1.Namespace, csiDriver driver.DynamicPVTestDriver, storageClassParameters map[string]string) (*TestStatefulset, []func())

func (*PodDetails) SetupWithDynamicMultipleVolumes added in v0.8.0

func (pod *PodDetails) SetupWithDynamicMultipleVolumes(client clientset.Interface, namespace *v1.Namespace, csiDriver driver.DynamicPVTestDriver) (*TestPod, []func())

SetupWithDynamicMultipleVolumes each pod will be mounted with multiple volumes with different storage account types

func (*PodDetails) SetupWithDynamicVolumes

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

func (*PodDetails) SetupWithDynamicVolumesWithSubpath added in v1.5.0

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

func (*PodDetails) SetupWithInlineVolumes added in v1.2.0

func (pod *PodDetails) SetupWithInlineVolumes(client clientset.Interface, namespace *v1.Namespace, csiDriver driver.PreProvisionedVolumeTestDriver, diskURI string, readOnly bool) (*TestPod, []func())

func (*PodDetails) SetupWithPreProvisionedVolumes

func (pod *PodDetails) SetupWithPreProvisionedVolumes(client clientset.Interface, namespace *v1.Namespace, csiDriver driver.PreProvisionedVolumeTestDriver, volumeContext map[string]string) (*TestPod, []func())

type PodExecCheck

type PodExecCheck struct {
	Cmd            []string
	ExpectedString string
}

type PodFailover added in v1.5.0

type PodFailover struct {
	CSIDriver              driver.DynamicPVTestDriver
	Pod                    PodDetails
	Volume                 VolumeDetails
	PodCheck               *PodExecCheck
	StorageClassParameters map[string]string
}
will provision required PV(s), PVC(s) and Pod(s)

Pod should successfully be re-scheduled on failover in a cluster with AzDriverNode and AzVolumeAttachment resources

func (*PodFailover) Run added in v1.5.0

func (t *PodFailover) Run(client clientset.Interface, namespace *v1.Namespace)

type PreProvisionedDanglingAttachVolumeTest added in v1.0.0

type PreProvisionedDanglingAttachVolumeTest struct {
	CSIDriver       driver.PreProvisionedVolumeTestDriver
	AzureDiskDriver azuredisk.CSIDriver
	Pod             PodDetails
	VolumeContext   map[string]string
}

PreProvisionedDanglingAttachVolumeTest will provision required PV(s), PVC(s) and Pod(s) Testing that a volume could be reattached to a different node on DanglingAttachError

func (*PreProvisionedDanglingAttachVolumeTest) Run added in v1.0.0

type PreProvisionedInlineVolumeTest added in v1.2.0

type PreProvisionedInlineVolumeTest struct {
	CSIDriver driver.PreProvisionedVolumeTestDriver
	Pods      []PodDetails
	DiskURI   string
	ReadOnly  bool
}

PreProvisionedInlineVolumeTest Waiting for the PV provisioner to create an inline volume Testing if the Pod(s) Cmd is run with a 0 exit code

func (*PreProvisionedInlineVolumeTest) Run added in v1.2.0

func (t *PreProvisionedInlineVolumeTest) Run(client clientset.Interface, namespace *v1.Namespace)

type PreProvisionedMultiplePodsTest added in v0.9.0

type PreProvisionedMultiplePodsTest struct {
	CSIDriver     driver.PreProvisionedVolumeTestDriver
	Pods          []PodDetails
	VolumeContext map[string]string
}

PreProvisionedMultiplePodsTest will provision required PV(s), PVC(s) and Pod(s) Testing that a volume could be mounted by multiple pods

func (*PreProvisionedMultiplePodsTest) Run added in v0.9.0

func (t *PreProvisionedMultiplePodsTest) Run(client clientset.Interface, namespace *v1.Namespace)

type PreProvisionedReadOnlyVolumeTest

type PreProvisionedReadOnlyVolumeTest struct {
	CSIDriver     driver.PreProvisionedVolumeTestDriver
	Pods          []PodDetails
	VolumeContext map[string]string
}

PreProvisionedReadOnlyVolumeTest will provision required PV(s), PVC(s) and Pod(s) Testing that the Pod(s) cannot write to the volume when mounted

func (*PreProvisionedReadOnlyVolumeTest) Run

type PreProvisionedReclaimPolicyTest

type PreProvisionedReclaimPolicyTest struct {
	CSIDriver     driver.PreProvisionedVolumeTestDriver
	Volumes       []VolumeDetails
	VolumeContext map[string]string
}

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

func (*PreProvisionedReclaimPolicyTest) Run

func (t *PreProvisionedReclaimPolicyTest) Run(client clientset.Interface, namespace *v1.Namespace)

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, isWindows bool, useCMD bool) *TestDeployment

func (*TestDeployment) Cleanup

func (t *TestDeployment) Cleanup()

func (*TestDeployment) Create

func (t *TestDeployment) Create()

func (*TestDeployment) DeletePodAndWait

func (t *TestDeployment) DeletePodAndWait()

func (*TestDeployment) Exec

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

func (*TestDeployment) Logs

func (t *TestDeployment) Logs() ([]byte, error)

func (*TestDeployment) WaitForPodReady

func (t *TestDeployment) WaitForPodReady()

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()

func (*TestPersistentVolumeClaim) Create

func (t *TestPersistentVolumeClaim) Create()

func (*TestPersistentVolumeClaim) DeleteBackingVolume

func (t *TestPersistentVolumeClaim) DeleteBackingVolume(driver azuredisk.CSIDriver)

func (*TestPersistentVolumeClaim) DeleteBoundPersistentVolume

func (t *TestPersistentVolumeClaim) DeleteBoundPersistentVolume()

func (*TestPersistentVolumeClaim) ReclaimPolicy

func (*TestPersistentVolumeClaim) ValidateProvisionedPersistentVolume

func (t *TestPersistentVolumeClaim) ValidateProvisionedPersistentVolume()

func (*TestPersistentVolumeClaim) WaitForBound

func (*TestPersistentVolumeClaim) WaitForPersistentVolumePhase

func (t *TestPersistentVolumeClaim) WaitForPersistentVolumePhase(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, isWindows bool) *TestPod

func (*TestPod) Cleanup

func (t *TestPod) Cleanup()

func (*TestPod) Create

func (t *TestPod) Create()

func (*TestPod) GetZoneForVolume added in v1.2.0

func (t *TestPod) GetZoneForVolume(index int) string

func (*TestPod) ListNodes added in v1.0.0

func (t *TestPod) ListNodes() []string

func (*TestPod) Logs

func (t *TestPod) Logs() ([]byte, error)

func (*TestPod) SetNodeSelector

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

func (*TestPod) SetNodeUnschedulable added in v1.0.0

func (t *TestPod) SetNodeUnschedulable(nodeName string, unschedulable bool)

func (*TestPod) SetupInlineVolume added in v1.2.0

func (t *TestPod) SetupInlineVolume(name, mountPath, diskURI 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 added in v1.5.0

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

func (*TestPod) WaitForFailedMountError added in v0.6.0

func (t *TestPod) WaitForFailedMountError()

func (*TestPod) WaitForFailure

func (t *TestPod) WaitForFailure()

func (*TestPod) WaitForRunning

func (t *TestPod) WaitForRunning()

func (*TestPod) WaitForRunningLong added in v1.0.0

func (t *TestPod) WaitForRunningLong()

func (*TestPod) WaitForSuccess

func (t *TestPod) WaitForSuccess()

type TestPreProvisionedPersistentVolume

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

func (*TestPreProvisionedPersistentVolume) Create

type TestStatefulset added in v0.9.0

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

func NewTestStatefulset added in v0.9.0

func NewTestStatefulset(c clientset.Interface, ns *v1.Namespace, command string, pvc *v1.PersistentVolumeClaim, volumeName, mountPath string, readOnly, isWindows, useCMD bool) *TestStatefulset

func (*TestStatefulset) Cleanup added in v0.9.0

func (t *TestStatefulset) Cleanup()

func (*TestStatefulset) Create added in v0.9.0

func (t *TestStatefulset) Create()

func (*TestStatefulset) DeletePodAndWait added in v0.9.0

func (t *TestStatefulset) DeletePodAndWait()

func (*TestStatefulset) Exec added in v0.9.0

func (t *TestStatefulset) Exec(command []string, expectedString string)

func (*TestStatefulset) Logs added in v0.9.0

func (t *TestStatefulset) Logs() ([]byte, error)

func (*TestStatefulset) WaitForPodReady added in v0.9.0

func (t *TestStatefulset) WaitForPodReady()

type TestStorageClass

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

func (*TestStorageClass) Cleanup

func (t *TestStorageClass) Cleanup()

func (*TestStorageClass) Create

type TestVolumeSnapshotClass

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

func CreateVolumeSnapshotClass

func CreateVolumeSnapshotClass(client restclientset.Interface, namespace *v1.Namespace, csiDriver driver.VolumeSnapshotTestDriver) (*TestVolumeSnapshotClass, func())

func (*TestVolumeSnapshotClass) Cleanup

func (t *TestVolumeSnapshotClass) Cleanup()

func (*TestVolumeSnapshotClass) Create

func (t *TestVolumeSnapshotClass) Create()

func (*TestVolumeSnapshotClass) CreateSnapshot

func (*TestVolumeSnapshotClass) DeleteSnapshot

func (t *TestVolumeSnapshotClass) DeleteSnapshot(vs *v1beta1.VolumeSnapshot)

func (*TestVolumeSnapshotClass) ReadyToUse

func (t *TestVolumeSnapshotClass) ReadyToUse(snapshot *v1beta1.VolumeSnapshot)

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 or pvc
	DataSource *DataSource
	// Optional, used with specified StorageClass
	StorageClass *storagev1.StorageClass
}

func (*VolumeDetails) CreateStorageClass added in v0.5.0

func (volume *VolumeDetails) CreateStorageClass(client clientset.Interface, namespace *v1.Namespace, csiDriver driver.DynamicPVTestDriver, storageClassParameters map[string]string) (*TestStorageClass, func())

func (*VolumeDetails) SetupDynamicPersistentVolumeClaim

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

func (*VolumeDetails) SetupPreProvisionedPersistentVolumeClaim

func (volume *VolumeDetails) SetupPreProvisionedPersistentVolumeClaim(client clientset.Interface, namespace *v1.Namespace, csiDriver driver.PreProvisionedVolumeTestDriver, volumeContext map[string]string) (*TestPersistentVolumeClaim, []func())

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