...

Package testsuites

import "k8s.io/kubernetes/test/e2e/storage/testsuites"
Overview
Index

Overview ▾

Index ▾

Variables
func AllEphemeralTestPatterns() []storageframework.TestPattern
func CSIEphemeralTestPatterns() []storageframework.TestPattern
func CSIInlineVolumesEnabled(ctx context.Context, c clientset.Interface, t *framework.TimeoutContext, ns string) (bool, error)
func ExpandPVCSize(ctx context.Context, origPVC *v1.PersistentVolumeClaim, size resource.Quantity, c clientset.Interface) (*v1.PersistentVolumeClaim, error)
func GenericEphemeralTestPatterns() []storageframework.TestPattern
func GenericEphemeralVolumesEnabled(ctx context.Context, c clientset.Interface, t *framework.TimeoutContext, ns string) (bool, error)
func InitCapacityTestSuite() storageframework.TestSuite
func InitCustomCapacityTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite
func InitCustomDisruptiveTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite
func InitCustomEphemeralTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite
func InitCustomFsGroupChangePolicyTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite
func InitCustomMultiVolumeTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite
func InitCustomProvisioningTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite
func InitCustomReadWriteOncePodTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite
func InitCustomSnapshottableStressTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite
func InitCustomSnapshottableTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite
func InitCustomSubPathTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite
func InitCustomTopologyTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite
func InitCustomVolumeExpandTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite
func InitCustomVolumeIOTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite
func InitCustomVolumeLimitsTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite
func InitCustomVolumeModeTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite
func InitCustomVolumeStressTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite
func InitCustomVolumesTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite
func InitDisruptiveTestSuite() storageframework.TestSuite
func InitEphemeralTestSuite() storageframework.TestSuite
func InitFsGroupChangePolicyTestSuite() storageframework.TestSuite
func InitMultiVolumeTestSuite() storageframework.TestSuite
func InitProvisioningTestSuite() storageframework.TestSuite
func InitReadWriteOncePodTestSuite() storageframework.TestSuite
func InitSnapshottableStressTestSuite() storageframework.TestSuite
func InitSnapshottableTestSuite() storageframework.TestSuite
func InitSubPathTestSuite() storageframework.TestSuite
func InitTopologyTestSuite() storageframework.TestSuite
func InitVolumeExpandTestSuite() storageframework.TestSuite
func InitVolumeIOTestSuite() storageframework.TestSuite
func InitVolumeLimitsTestSuite() storageframework.TestSuite
func InitVolumeModeTestSuite() storageframework.TestSuite
func InitVolumePerformanceTestSuite() storageframework.TestSuite
func InitVolumeStressTestSuite() storageframework.TestSuite
func InitVolumesTestSuite() storageframework.TestSuite
func MatchCapacities(match types.GomegaMatcher) types.GomegaMatcher
func MultiplePVMountSingleNodeCheck(ctx context.Context, client clientset.Interface, timeouts *framework.TimeoutContext, claim *v1.PersistentVolumeClaim, node e2epod.NodeSelection)
func PVMultiNodeCheck(ctx context.Context, client clientset.Interface, timeouts *framework.TimeoutContext, claim *v1.PersistentVolumeClaim, node e2epod.NodeSelection)
func PVWriteReadSingleNodeCheck(ctx context.Context, client clientset.Interface, timeouts *framework.TimeoutContext, claim *v1.PersistentVolumeClaim, node e2epod.NodeSelection) *v1.PersistentVolume
func RunInPodWithVolume(ctx context.Context, c clientset.Interface, t *framework.TimeoutContext, ns, claimName, podName, command string, node e2epod.NodeSelection) *v1.Pod
func SetupStorageClass(ctx context.Context, client clientset.Interface, class *storagev1.StorageClass) *storagev1.StorageClass
func StartInPodWithInlineVolume(ctx context.Context, c clientset.Interface, ns, podName, command string, volumes []v1.VolumeSource, readOnly bool, node e2epod.NodeSelection) *v1.Pod
func StartInPodWithVolume(ctx context.Context, c clientset.Interface, ns, claimName, podName, command string, node e2epod.NodeSelection) *v1.Pod
func StartInPodWithVolumeSource(ctx context.Context, c clientset.Interface, volSrc v1.VolumeSource, ns, podName, command string, node e2epod.NodeSelection) *v1.Pod
func StopPod(ctx context.Context, c clientset.Interface, pod *v1.Pod)
func StopPodAndDependents(ctx context.Context, c clientset.Interface, timeouts *framework.TimeoutContext, pod *v1.Pod)
func SubpathTestPod(f *framework.Framework, subpath, volumeType string, source *v1.VolumeSource, securityLevel admissionapi.Level) *v1.Pod
func TestAccessMultipleVolumesAcrossPodRecreation(ctx context.Context, f *framework.Framework, cs clientset.Interface, ns string, node e2epod.NodeSelection, pvcs []*v1.PersistentVolumeClaim, requiresSameNode bool)
func TestBasicSubpath(ctx context.Context, f *framework.Framework, contents string, pod *v1.Pod)
func TestBasicSubpathFile(ctx context.Context, f *framework.Framework, contents string, pod *v1.Pod, filepath string)
func TestConcurrentAccessToRelatedVolumes(ctx context.Context, f *framework.Framework, cs clientset.Interface, ns string, node e2epod.NodeSelection, pvcs []*v1.PersistentVolumeClaim, expectedContent string)
func TestConcurrentAccessToSingleVolume(ctx context.Context, f *framework.Framework, cs clientset.Interface, ns string, node e2epod.NodeSelection, pvc *v1.PersistentVolumeClaim, numPods int, requiresSameNode bool, readOnly bool)
func TestPodContainerRestartWithConfigmapModified(ctx context.Context, f *framework.Framework, original, modified *v1.ConfigMap)
func VolumeSourceEnabled(ctx context.Context, c clientset.Interface, t *framework.TimeoutContext, ns string, volume v1.VolumeSource) (bool, error)
func WaitForControllerVolumeResize(ctx context.Context, pvc *v1.PersistentVolumeClaim, c clientset.Interface, timeout time.Duration) error
func WaitForFSResize(ctx context.Context, pvc *v1.PersistentVolumeClaim, c clientset.Interface) (*v1.PersistentVolumeClaim, error)
func WaitForPendingFSResizeCondition(ctx context.Context, pvc *v1.PersistentVolumeClaim, c clientset.Interface) (*v1.PersistentVolumeClaim, error)
func WaitForResizingCondition(ctx context.Context, pvc *v1.PersistentVolumeClaim, c clientset.Interface, duration time.Duration) error
type CapacityMatcher
    func HaveCapacitiesForClass(scName string) CapacityMatcher
    func HaveCapacitiesForClassAndNodes(ctx context.Context, client kubernetes.Interface, driverName, scName, topologyKey string) CapacityMatcher
type EphemeralTest
    func (t EphemeralTest) TestEphemeral(ctx context.Context)
type StorageClassTest
    func (t StorageClassTest) TestBindingWaitForFirstConsumerMultiPVC(ctx context.Context, claims []*v1.PersistentVolumeClaim, nodeSelector map[string]string, expectUnschedulable bool) ([]*v1.PersistentVolume, *v1.Node)
    func (t StorageClassTest) TestDynamicProvisioning(ctx context.Context) *v1.PersistentVolume

Package files

base.go capacity.go disruptive.go ephemeral.go fsgroupchangepolicy.go multivolume.go provisioning.go readwriteoncepod.go snapshottable.go snapshottable_stress.go subpath.go topology.go volume_expand.go volume_io.go volume_stress.go volumelimits.go volumemode.go volumeperf.go volumes.go

Variables

BaseSuites is a list of storage test suites that work for in-tree and CSI drivers

var BaseSuites = []func() storageframework.TestSuite{
    InitCapacityTestSuite,
    InitVolumesTestSuite,
    InitVolumeIOTestSuite,
    InitVolumeModeTestSuite,
    InitSubPathTestSuite,
    InitProvisioningTestSuite,
    InitMultiVolumeTestSuite,
    InitVolumeExpandTestSuite,
    InitDisruptiveTestSuite,
    InitVolumeLimitsTestSuite,
    InitTopologyTestSuite,
    InitVolumeStressTestSuite,
    InitFsGroupChangePolicyTestSuite,
    func() storageframework.TestSuite {
        return InitCustomEphemeralTestSuite(GenericEphemeralTestPatterns())
    },
}

CSISuites is a list of storage test suites that work only for CSI drivers

var CSISuites = append(BaseSuites,
    func() storageframework.TestSuite {
        return InitCustomEphemeralTestSuite(CSIEphemeralTestPatterns())
    },
    InitSnapshottableTestSuite,
    InitSnapshottableStressTestSuite,
    InitVolumePerformanceTestSuite,
    InitReadWriteOncePodTestSuite,
)

func AllEphemeralTestPatterns

func AllEphemeralTestPatterns() []storageframework.TestPattern

AllEphemeralTestPatterns returns all pre-defined test patterns for generic and CSI ephemeral inline volumes.

func CSIEphemeralTestPatterns

func CSIEphemeralTestPatterns() []storageframework.TestPattern

CSIEphemeralTestPatterns returns the test patterns for CSI ephemeral inline volumes.

func CSIInlineVolumesEnabled

func CSIInlineVolumesEnabled(ctx context.Context, c clientset.Interface, t *framework.TimeoutContext, ns string) (bool, error)

CSIInlineVolumesEnabled checks whether the running cluster has the CSIInlineVolumes feature gate enabled. It does that by trying to create a pod that uses that feature.

func ExpandPVCSize

func ExpandPVCSize(ctx context.Context, origPVC *v1.PersistentVolumeClaim, size resource.Quantity, c clientset.Interface) (*v1.PersistentVolumeClaim, error)

ExpandPVCSize expands PVC size

func GenericEphemeralTestPatterns

func GenericEphemeralTestPatterns() []storageframework.TestPattern

GenericEphemeralTestPatterns returns the test patterns for generic ephemeral inline volumes.

func GenericEphemeralVolumesEnabled

func GenericEphemeralVolumesEnabled(ctx context.Context, c clientset.Interface, t *framework.TimeoutContext, ns string) (bool, error)

GenericEphemeralVolumesEnabled checks whether the running cluster has the GenericEphemeralVolume feature gate enabled. It does that by trying to create a pod that uses that feature.

func InitCapacityTestSuite

func InitCapacityTestSuite() storageframework.TestSuite

InitCapacityTestSuite returns capacityTestSuite that implements TestSuite interface\ using test suite default patterns

func InitCustomCapacityTestSuite

func InitCustomCapacityTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite

InitCustomCapacityTestSuite returns capacityTestSuite that implements TestSuite interface using custom test patterns

func InitCustomDisruptiveTestSuite

func InitCustomDisruptiveTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite

InitCustomDisruptiveTestSuite returns subPathTestSuite that implements TestSuite interface using custom test patterns

func InitCustomEphemeralTestSuite

func InitCustomEphemeralTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite

InitCustomEphemeralTestSuite returns ephemeralTestSuite that implements TestSuite interface using custom test patterns

func InitCustomFsGroupChangePolicyTestSuite

func InitCustomFsGroupChangePolicyTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite

InitCustomFsGroupChangePolicyTestSuite returns fsGroupChangePolicyTestSuite that implements TestSuite interface

func InitCustomMultiVolumeTestSuite

func InitCustomMultiVolumeTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite

InitCustomMultiVolumeTestSuite returns multiVolumeTestSuite that implements TestSuite interface using custom test patterns

func InitCustomProvisioningTestSuite

func InitCustomProvisioningTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite

InitCustomProvisioningTestSuite returns provisioningTestSuite that implements TestSuite interface using custom test patterns

func InitCustomReadWriteOncePodTestSuite

func InitCustomReadWriteOncePodTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite

func InitCustomSnapshottableStressTestSuite

func InitCustomSnapshottableStressTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite

InitCustomSnapshottableStressTestSuite returns snapshottableStressTestSuite that implements TestSuite interface using custom test patterns

func InitCustomSnapshottableTestSuite

func InitCustomSnapshottableTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite

InitCustomSnapshottableTestSuite returns snapshottableTestSuite that implements TestSuite interface using custom test patterns

func InitCustomSubPathTestSuite

func InitCustomSubPathTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite

InitCustomSubPathTestSuite returns subPathTestSuite that implements TestSuite interface using custom test patterns

func InitCustomTopologyTestSuite

func InitCustomTopologyTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite

InitCustomTopologyTestSuite returns topologyTestSuite that implements TestSuite interface using custom test patterns

func InitCustomVolumeExpandTestSuite

func InitCustomVolumeExpandTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite

InitCustomVolumeExpandTestSuite returns volumeExpandTestSuite that implements TestSuite interface using custom test patterns

func InitCustomVolumeIOTestSuite

func InitCustomVolumeIOTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite

InitCustomVolumeIOTestSuite returns volumeIOTestSuite that implements TestSuite interface using custom test patterns

func InitCustomVolumeLimitsTestSuite

func InitCustomVolumeLimitsTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite

InitCustomVolumeLimitsTestSuite returns volumeLimitsTestSuite that implements TestSuite interface using custom test patterns

func InitCustomVolumeModeTestSuite

func InitCustomVolumeModeTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite

InitCustomVolumeModeTestSuite returns volumeModeTestSuite that implements TestSuite interface using custom test patterns

func InitCustomVolumeStressTestSuite

func InitCustomVolumeStressTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite

InitCustomVolumeStressTestSuite returns volumeStressTestSuite that implements TestSuite interface using custom test patterns

func InitCustomVolumesTestSuite

func InitCustomVolumesTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite

InitCustomVolumesTestSuite returns volumesTestSuite that implements TestSuite interface using custom test patterns

func InitDisruptiveTestSuite

func InitDisruptiveTestSuite() storageframework.TestSuite

InitDisruptiveTestSuite returns subPathTestSuite that implements TestSuite interface using test suite default patterns

func InitEphemeralTestSuite

func InitEphemeralTestSuite() storageframework.TestSuite

InitEphemeralTestSuite returns ephemeralTestSuite that implements TestSuite interface using test suite default patterns

func InitFsGroupChangePolicyTestSuite

func InitFsGroupChangePolicyTestSuite() storageframework.TestSuite

InitFsGroupChangePolicyTestSuite returns fsGroupChangePolicyTestSuite that implements TestSuite interface

func InitMultiVolumeTestSuite

func InitMultiVolumeTestSuite() storageframework.TestSuite

InitMultiVolumeTestSuite returns multiVolumeTestSuite that implements TestSuite interface using test suite default patterns

func InitProvisioningTestSuite

func InitProvisioningTestSuite() storageframework.TestSuite

InitProvisioningTestSuite returns provisioningTestSuite that implements TestSuite interface\ using test suite default patterns

func InitReadWriteOncePodTestSuite

func InitReadWriteOncePodTestSuite() storageframework.TestSuite

InitReadWriteOncePodTestSuite returns a test suite for the ReadWriteOncePod PersistentVolume access mode feature.

func InitSnapshottableStressTestSuite

func InitSnapshottableStressTestSuite() storageframework.TestSuite

InitSnapshottableStressTestSuite returns snapshottableStressTestSuite that implements TestSuite interface using testsuite default patterns

func InitSnapshottableTestSuite

func InitSnapshottableTestSuite() storageframework.TestSuite

InitSnapshottableTestSuite returns snapshottableTestSuite that implements TestSuite interface using testsuite default patterns

func InitSubPathTestSuite

func InitSubPathTestSuite() storageframework.TestSuite

InitSubPathTestSuite returns subPathTestSuite that implements TestSuite interface using testsuite default patterns

func InitTopologyTestSuite

func InitTopologyTestSuite() storageframework.TestSuite

InitTopologyTestSuite returns topologyTestSuite that implements TestSuite interface using testsuite default patterns

func InitVolumeExpandTestSuite

func InitVolumeExpandTestSuite() storageframework.TestSuite

InitVolumeExpandTestSuite returns volumeExpandTestSuite that implements TestSuite interface using testsuite default patterns

func InitVolumeIOTestSuite

func InitVolumeIOTestSuite() storageframework.TestSuite

InitVolumeIOTestSuite returns volumeIOTestSuite that implements TestSuite interface using testsuite default patterns

func InitVolumeLimitsTestSuite

func InitVolumeLimitsTestSuite() storageframework.TestSuite

InitVolumeLimitsTestSuite returns volumeLimitsTestSuite that implements TestSuite interface using testsuite default patterns

func InitVolumeModeTestSuite

func InitVolumeModeTestSuite() storageframework.TestSuite

InitVolumeModeTestSuite returns volumeModeTestSuite that implements TestSuite interface using testsuite default patterns

func InitVolumePerformanceTestSuite

func InitVolumePerformanceTestSuite() storageframework.TestSuite

InitVolumePerformanceTestSuite returns volumePerformanceTestSuite that implements TestSuite interface

func InitVolumeStressTestSuite

func InitVolumeStressTestSuite() storageframework.TestSuite

InitVolumeStressTestSuite returns volumeStressTestSuite that implements TestSuite interface using testsuite default patterns

func InitVolumesTestSuite

func InitVolumesTestSuite() storageframework.TestSuite

InitVolumesTestSuite returns volumesTestSuite that implements TestSuite interface using testsuite default patterns

func MatchCapacities

func MatchCapacities(match types.GomegaMatcher) types.GomegaMatcher

MatchCapacities runs some kind of check against *storagev1.CSIStorageCapacityList. In case of failure, all actual objects are appended to the failure message.

func MultiplePVMountSingleNodeCheck

func MultiplePVMountSingleNodeCheck(ctx context.Context, client clientset.Interface, timeouts *framework.TimeoutContext, claim *v1.PersistentVolumeClaim, node e2epod.NodeSelection)

MultiplePVMountSingleNodeCheck checks that multiple PV pointing to the same underlying storage can be mounted simultaneously on a single node.

Steps: - Start Pod1 using PVC1, PV1 (which points to a underlying volume v) on node N1. - Create PVC2, PV2 and prebind them. PV2 points to the same underlying volume v. - Start Pod2 using PVC2, PV2 (which points to a underlying volume v) on node N1.

func PVMultiNodeCheck

func PVMultiNodeCheck(ctx context.Context, client clientset.Interface, timeouts *framework.TimeoutContext, claim *v1.PersistentVolumeClaim, node e2epod.NodeSelection)

PVMultiNodeCheck checks that a PV retains data when moved between nodes.

It starts these pods: - The first pod writes 'hello word' to the /mnt/test (= the volume) on one node. - The second pod runs grep 'hello world' on /mnt/test on another node.

The first node is selected by Kubernetes when scheduling the first pod. The second pod uses the same criteria, except that a special anti-affinity for the first node gets added. This test can only pass if the cluster has more than one suitable node. The caller has to ensure that.

If all succeeds, Kubernetes actually allocated something that is persistent across pods and across nodes.

This is a common test that can be called from a StorageClassTest.PvCheck.

func PVWriteReadSingleNodeCheck

func PVWriteReadSingleNodeCheck(ctx context.Context, client clientset.Interface, timeouts *framework.TimeoutContext, claim *v1.PersistentVolumeClaim, node e2epod.NodeSelection) *v1.PersistentVolume

PVWriteReadSingleNodeCheck checks that a PV retains data on a single node and returns the PV.

It starts two pods: - The first pod writes 'hello word' to the /mnt/test (= the volume) on one node. - The second pod runs grep 'hello world' on /mnt/test on the same node.

The node is selected by Kubernetes when scheduling the first pod. It's then selected via its name for the second pod.

If both succeed, Kubernetes actually allocated something that is persistent across pods.

This is a common test that can be called from a StorageClassTest.PvCheck.

func RunInPodWithVolume

func RunInPodWithVolume(ctx context.Context, c clientset.Interface, t *framework.TimeoutContext, ns, claimName, podName, command string, node e2epod.NodeSelection) *v1.Pod

RunInPodWithVolume runs a command in a pod with given claim mounted to /mnt directory. It starts, checks, collects output and stops it.

func SetupStorageClass

func SetupStorageClass(
    ctx context.Context,
    client clientset.Interface,
    class *storagev1.StorageClass,
) *storagev1.StorageClass

SetupStorageClass ensures that a StorageClass from a spec exists, if the StorageClass already exists then it's returned as it is, if it doesn't exist then it's created first and then returned, if the spec is nil then we return the `default` StorageClass

func StartInPodWithInlineVolume

func StartInPodWithInlineVolume(ctx context.Context, c clientset.Interface, ns, podName, command string, volumes []v1.VolumeSource, readOnly bool, node e2epod.NodeSelection) *v1.Pod

StartInPodWithInlineVolume starts a command in a pod with given volume(s) mounted to /mnt/test-<number> directory. The caller is responsible for checking the pod and deleting it.

func StartInPodWithVolume

func StartInPodWithVolume(ctx context.Context, c clientset.Interface, ns, claimName, podName, command string, node e2epod.NodeSelection) *v1.Pod

StartInPodWithVolume starts a command in a pod with given claim mounted to /mnt directory The caller is responsible for checking the pod and deleting it.

func StartInPodWithVolumeSource

func StartInPodWithVolumeSource(ctx context.Context, c clientset.Interface, volSrc v1.VolumeSource, ns, podName, command string, node e2epod.NodeSelection) *v1.Pod

StartInPodWithVolumeSource starts a command in a pod with given volume mounted to /mnt directory The caller is responsible for checking the pod and deleting it.

func StopPod

func StopPod(ctx context.Context, c clientset.Interface, pod *v1.Pod)

StopPod first tries to log the output of the pod's container, then deletes the pod and waits for that to succeed.

func StopPodAndDependents

func StopPodAndDependents(ctx context.Context, c clientset.Interface, timeouts *framework.TimeoutContext, pod *v1.Pod)

StopPodAndDependents first tries to log the output of the pod's container, then deletes the pod and waits for that to succeed. Also waits for all owned resources to be deleted.

func SubpathTestPod

func SubpathTestPod(f *framework.Framework, subpath, volumeType string, source *v1.VolumeSource, securityLevel admissionapi.Level) *v1.Pod

SubpathTestPod returns a pod spec for subpath tests

func TestAccessMultipleVolumesAcrossPodRecreation

func TestAccessMultipleVolumesAcrossPodRecreation(ctx context.Context, f *framework.Framework, cs clientset.Interface, ns string,
    node e2epod.NodeSelection, pvcs []*v1.PersistentVolumeClaim, requiresSameNode bool)

TestAccessMultipleVolumesAcrossPodRecreation tests access to multiple volumes from single pod, then recreate pod on the same or different node depending on requiresSameNode, and recheck access to the volumes from the recreated pod

func TestBasicSubpath

func TestBasicSubpath(ctx context.Context, f *framework.Framework, contents string, pod *v1.Pod)

TestBasicSubpath runs basic subpath test

func TestBasicSubpathFile

func TestBasicSubpathFile(ctx context.Context, f *framework.Framework, contents string, pod *v1.Pod, filepath string)

TestBasicSubpathFile runs basic subpath file test

func TestConcurrentAccessToRelatedVolumes

func TestConcurrentAccessToRelatedVolumes(ctx context.Context, f *framework.Framework, cs clientset.Interface, ns string,
    node e2epod.NodeSelection, pvcs []*v1.PersistentVolumeClaim, expectedContent string)

TestConcurrentAccessToRelatedVolumes tests access to multiple volumes from multiple pods. Each provided PVC is used by a single pod. The test ensures that volumes created from another volume (=clone) or volume snapshot can be used together with the original volume.

func TestConcurrentAccessToSingleVolume

func TestConcurrentAccessToSingleVolume(ctx context.Context, f *framework.Framework, cs clientset.Interface, ns string,
    node e2epod.NodeSelection, pvc *v1.PersistentVolumeClaim, numPods int, requiresSameNode bool,
    readOnly bool)

TestConcurrentAccessToSingleVolume tests access to a single volume from multiple pods, then delete the last pod, and recheck access to the volume after pod deletion to check if other pod deletion doesn't affect. Pods are deployed on the same node or different nodes depending on requiresSameNode. Read/write check are done across pod, by check reading both what pod{n-1} and pod{n} wrote from pod{n}.

func TestPodContainerRestartWithConfigmapModified

func TestPodContainerRestartWithConfigmapModified(ctx context.Context, f *framework.Framework, original, modified *v1.ConfigMap)

TestPodContainerRestartWithConfigmapModified tests that container can restart to stabilize when configmap has been modified. 1. valid container running 2. update configmap 3. container restarts 4. container becomes stable after configmap mounted file has been modified

func VolumeSourceEnabled

func VolumeSourceEnabled(ctx context.Context, c clientset.Interface, t *framework.TimeoutContext, ns string, volume v1.VolumeSource) (bool, error)

VolumeSourceEnabled checks whether a certain kind of volume source is enabled by trying to create a pod that uses it.

func WaitForControllerVolumeResize

func WaitForControllerVolumeResize(ctx context.Context, pvc *v1.PersistentVolumeClaim, c clientset.Interface, timeout time.Duration) error

WaitForControllerVolumeResize waits for the controller resize to be finished

func WaitForFSResize

func WaitForFSResize(ctx context.Context, pvc *v1.PersistentVolumeClaim, c clientset.Interface) (*v1.PersistentVolumeClaim, error)

WaitForFSResize waits for the filesystem in the pv to be resized

func WaitForPendingFSResizeCondition

func WaitForPendingFSResizeCondition(ctx context.Context, pvc *v1.PersistentVolumeClaim, c clientset.Interface) (*v1.PersistentVolumeClaim, error)

WaitForPendingFSResizeCondition waits for pvc to have resize condition

func WaitForResizingCondition

func WaitForResizingCondition(ctx context.Context, pvc *v1.PersistentVolumeClaim, c clientset.Interface, duration time.Duration) error

WaitForResizingCondition waits for the pvc condition to be PersistentVolumeClaimResizing

type CapacityMatcher

CapacityMatcher can be used to compose different matchers where one adds additional checks for CSIStorageCapacity objects already checked by another.

type CapacityMatcher interface {
    types.GomegaMatcher
    // MatchedCapacities returns all CSICapacityObjects which were
    // found during the preceding Match call.
    MatchedCapacities() []storagev1.CSIStorageCapacity
}

func HaveCapacitiesForClass

func HaveCapacitiesForClass(scName string) CapacityMatcher

HaveCapacitiesForClass filters all storage capacity objects in a *storagev1.CSIStorageCapacityList by storage class. Success is when when there is at least one.

func HaveCapacitiesForClassAndNodes

func HaveCapacitiesForClassAndNodes(ctx context.Context, client kubernetes.Interface, driverName, scName, topologyKey string) CapacityMatcher

HaveCapacitiesForClassAndNodes matches objects by storage class name. It finds all nodes on which the driver runs and expects one object per node.

type EphemeralTest

EphemeralTest represents parameters to be used by tests for inline volumes. Not all parameters are used by all tests.

type EphemeralTest struct {
    Client     clientset.Interface
    Timeouts   *framework.TimeoutContext
    Namespace  string
    DriverName string
    VolSource  *v1.VolumeSource
    Node       e2epod.NodeSelection

    // GetVolume returns the volume attributes for a
    // certain inline ephemeral volume, enumerated starting with
    // #0. Some tests might require more than one volume. They can
    // all be the same or different, depending what the driver supports
    // and/or wants to test.
    //
    // For each volume, the test driver can specify the
    // attributes, whether two pods using those attributes will
    // end up sharing the same backend storage (i.e. changes made
    // in one pod will be visible in the other), and whether
    // the volume can be mounted read/write or only read-only.
    GetVolume func(volumeNumber int) (attributes map[string]string, shared bool, readOnly bool)

    // RunningPodCheck is invoked while a pod using an inline volume is running.
    // It can execute additional checks on the pod and its volume(s). Any data
    // returned by it is passed to StoppedPodCheck.
    RunningPodCheck func(ctx context.Context, pod *v1.Pod) interface{}

    // StoppedPodCheck is invoked after ensuring that the pod is gone.
    // It is passed the data gather by RunningPodCheck or nil if that
    // isn't defined and then can do additional checks on the node,
    // like for example verifying that the ephemeral volume was really
    // removed. How to do such a check is driver-specific and not
    // covered by the generic storage test suite.
    StoppedPodCheck func(ctx context.Context, nodeName string, runningPodData interface{})

    // NumInlineVolumes sets the number of ephemeral inline volumes per pod.
    // Unset (= zero) is the same as one.
    NumInlineVolumes int

    // ReadOnly limits mounting to read-only.
    ReadOnly bool
}

func (EphemeralTest) TestEphemeral

func (t EphemeralTest) TestEphemeral(ctx context.Context)

TestEphemeral tests pod creation with one ephemeral volume.

type StorageClassTest

StorageClassTest represents parameters to be used by provisioning tests. Not all parameters are used by all tests.

type StorageClassTest struct {
    Client               clientset.Interface
    Timeouts             *framework.TimeoutContext
    Claim                *v1.PersistentVolumeClaim
    SourceClaim          *v1.PersistentVolumeClaim
    Class                *storagev1.StorageClass
    Name                 string
    CloudProviders       []string
    Provisioner          string
    Parameters           map[string]string
    DelayBinding         bool
    ClaimSize            string
    ExpectedSize         string
    PvCheck              func(ctx context.Context, claim *v1.PersistentVolumeClaim)
    VolumeMode           v1.PersistentVolumeMode
    AllowVolumeExpansion bool
    NodeSelection        e2epod.NodeSelection
    MountOptions         []string
}

func (StorageClassTest) TestBindingWaitForFirstConsumerMultiPVC

func (t StorageClassTest) TestBindingWaitForFirstConsumerMultiPVC(ctx context.Context, claims []*v1.PersistentVolumeClaim, nodeSelector map[string]string, expectUnschedulable bool) ([]*v1.PersistentVolume, *v1.Node)

TestBindingWaitForFirstConsumerMultiPVC tests the binding with WaitForFirstConsumer mode

func (StorageClassTest) TestDynamicProvisioning

func (t StorageClassTest) TestDynamicProvisioning(ctx context.Context) *v1.PersistentVolume

TestDynamicProvisioning tests dynamic provisioning with specified StorageClassTest it's assumed that the StorageClass `t.Class` is already provisioned, see #ProvisionStorageClass