testsuites

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VolumeSnapshotKind      = "VolumeSnapshot"
	SnapshotAPIVersion      = "snapshot.storage.k8s.io/v1"
	APIVersionv1            = "v1"
	VolumeSnapshotClassKind = "VolumeSnapshotClass"
)
View Source
const (
	//VolumeIDSeperator ...
	VolumeIDSeperator = "#"
	//DeprecatedVolumeIDSeperator ...
	DeprecatedVolumeIDSeperator = ":"
)
View Source
const (
	BusyboxTestImage = "gcr.io/google_containers/busybox:1.24"
	MountPath        = "/devtestvol"
)

Variables

View Source
var (
	SnapshotAPIGroup = "snapshot.storage.k8s.io"
	VPCService       *vpcbetav1.VpcbetaV1
)

Functions

func GetVolumeSnapshotClass

func GetVolumeSnapshotClass(namespace string) *volumesnapshotv1.VolumeSnapshotClass

func InitializeVPCClient

func InitializeVPCClient()

func WaitForFileSystemToResize

func WaitForFileSystemToResize(t *TestPod, expectedOut int64, timeout time.Duration, interval time.Duration) error

WaitForFileSystemToResize waiting for pvc size to be resized to desired size

func WaitForPvToResize

func WaitForPvToResize(c clientset.Interface, ns *v1.Namespace, pvName string, desiredSize resource.Quantity, timeout time.Duration, interval time.Duration) error

WaitForPvToResize waiting for pvc size to be resized to desired size

Types

type DaemonsetWithVolWRTest

type DaemonsetWithVolWRTest struct {
	Pod          PodDetails
	PodCheck     *PodExecCheck
	Labels       map[string]string
	ReplicaCount int32
	ServiceName  string
}

func (*DaemonsetWithVolWRTest) Run

func (t *DaemonsetWithVolWRTest) Run(client clientset.Interface, namespace *v1.Namespace, drainNode bool)

type DataSource

type DataSource struct {
	Name string
}

type DynamicallyProvisioneDeployWithVolWRTest

type DynamicallyProvisioneDeployWithVolWRTest struct {
	Pod          PodDetails
	PodCheck     *PodExecCheck
	ReplicaCount int32
}

DynamicallyProvisioneVolPodWRTest will provision required PVC 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 (*DynamicallyProvisioneDeployWithVolWRTest) Run

func (*DynamicallyProvisioneDeployWithVolWRTest) RunMultiVol

func (t *DynamicallyProvisioneDeployWithVolWRTest) RunMultiVol(client clientset.Interface, namespace *v1.Namespace)

func (*DynamicallyProvisioneDeployWithVolWRTest) RunShouldFail added in v1.2.5

func (t *DynamicallyProvisioneDeployWithVolWRTest) RunShouldFail(client clientset.Interface, namespace *v1.Namespace)

type DynamicallyProvisioneMultiPodWithVolTest

type DynamicallyProvisioneMultiPodWithVolTest struct {
	Pods     []PodDetails
	PodCheck *PodExecCheck
}

DynamicallyProvisioneVolPodWRTest will provision required PVC 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 (*DynamicallyProvisioneMultiPodWithVolTest) RunAsync

func (*DynamicallyProvisioneMultiPodWithVolTest) RunSync

type DynamicallyProvisionePodWithVolTest

type DynamicallyProvisionePodWithVolTest struct {
	Pods     []PodDetails
	PodCheck *PodExecCheck
}

DynamicallyProvisioneVolPodWRTest will provision required PVC 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 (*DynamicallyProvisionePodWithVolTest) Run

type DynamicallyProvisionedResizeVolumeTest

type DynamicallyProvisionedResizeVolumeTest struct {
	Pods           []PodDetails
	PodCheck       *PodExecCheck
	ExpandVolSizeG int64
	ExpandedSize   int64
}

DynamicallyProvisionedResizeVolumeTest will provision required StorageClass(es), PVC(s) and Pod(s) Waiting for the PV provisioner to create a new PV Update pvc storage size Waiting for new PVC and PV to be ready And finally attach pvc to the pod and wait for pod to be ready.

func (*DynamicallyProvisionedResizeVolumeTest) Run

type PodDetails

type PodDetails struct {
	Cmd          string
	CmdExits     bool
	Volumes      []VolumeDetails
	NodeSelector map[string]string
}

func (*PodDetails) SetupDaemonset

func (pod *PodDetails) SetupDaemonset(client clientset.Interface, namespace *v1.Namespace, serviceName string, labels map[string]string) (*TestDaemonsets, []func())

func (*PodDetails) SetupDeployment

func (pod *PodDetails) SetupDeployment(client clientset.Interface, namespace *v1.Namespace, replicaCount int32) (*TestDeployment, []func())

func (*PodDetails) SetupDeploymentWithMultiVol

func (pod *PodDetails) SetupDeploymentWithMultiVol(client clientset.Interface, namespace *v1.Namespace) (*TestDeployment, []func())

func (*PodDetails) SetupStatefulset

func (pod *PodDetails) SetupStatefulset(client clientset.Interface, namespace *v1.Namespace, serviceName string, labels map[string]string, replicaCount int32) (*TestStatefulsets, []func())

func (*PodDetails) SetupWithDynamicVolumes

func (pod *PodDetails) SetupWithDynamicVolumes(client clientset.Interface, namespace *v1.Namespace) (*TestPod, []func())

func (*PodDetails) SetupWithPVC

func (pod *PodDetails) SetupWithPVC(client clientset.Interface, namespace *v1.Namespace, name string) (*TestPod, []func())

type PodExecCheck

type PodExecCheck struct {
	Cmd              []string
	ExpectedString01 string
	ExpectedString02 string
}

type StatefulsetWithVolWRTest

type StatefulsetWithVolWRTest struct {
	Pod          PodDetails
	PodCheck     *PodExecCheck
	Labels       map[string]string
	ReplicaCount int32
	ServiceName  string
}

func (*StatefulsetWithVolWRTest) Run

func (t *StatefulsetWithVolWRTest) Run(client clientset.Interface, namespace *v1.Namespace, drainNode bool)

type TestDaemonsets

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

func (*TestDaemonsets) Cleanup

func (t *TestDaemonsets) Cleanup()

func (*TestDaemonsets) Create

func (t *TestDaemonsets) Create()

func (*TestDaemonsets) Exec

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

func (*TestDaemonsets) Logs

func (t *TestDaemonsets) Logs()

func (*TestDaemonsets) WaitForPodReady

func (t *TestDaemonsets) WaitForPodReady()

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, replicaCount int32, nodeSelector map[string]string) *TestDeployment

func NewTestDeploymentWitoutPVC

func NewTestDeploymentWitoutPVC(c clientset.Interface, ns *v1.Namespace, command string) *TestDeployment

func (*TestDeployment) Cleanup

func (t *TestDeployment) Cleanup()

func (*TestDeployment) Create

func (t *TestDeployment) Create()

func (*TestDeployment) CreateWithoutWaitingForDeploymemtStatus added in v1.2.5

func (t *TestDeployment) CreateWithoutWaitingForDeploymemtStatus()

CreateWithoutWaitingForDeploymemtStatus creates deployment without waiting for the pods to be in running state.

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

func (*TestDeployment) SetupVolume

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

func (*TestDeployment) WaitForPodReady

func (t *TestDeployment) WaitForPodReady()

type TestHeadlessService

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

func NewHeadlessService

func NewHeadlessService(c clientset.Interface, name, namespace, labelSelctors string) *TestHeadlessService

func (*TestHeadlessService) Cleanup

func (h *TestHeadlessService) Cleanup()

func (*TestHeadlessService) Create

func (h *TestHeadlessService) Create() v1.Service

type TestPersistentVolumeClaim

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

func NewTestPersistentVolumeClaim

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

func NewTestPersistentVolumeClaimWithDataSource

func NewTestPersistentVolumeClaimWithDataSource(
	c clientset.Interface, pvcName string, 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) DeleteBoundPersistentVolume

func (t *TestPersistentVolumeClaim) DeleteBoundPersistentVolume()

func (*TestPersistentVolumeClaim) NewTestDaemonset

func (t *TestPersistentVolumeClaim) NewTestDaemonset(c clientset.Interface, ns *v1.Namespace, pvc *v1.PersistentVolumeClaim, command, storageClassName, volumeName, mountPath string, labels map[string]string) *TestDaemonsets

func (*TestPersistentVolumeClaim) NewTestStatefulset

func (t *TestPersistentVolumeClaim) NewTestStatefulset(c clientset.Interface, ns *v1.Namespace, servicename, command, storageClassName, volumeName, mountPath string, labels map[string]string, replicaCount int32) *TestStatefulsets

func (*TestPersistentVolumeClaim) ReclaimPolicy

func (*TestPersistentVolumeClaim) ValidateProvisionedPersistentVolume

func (t *TestPersistentVolumeClaim) ValidateProvisionedPersistentVolume()

func (*TestPersistentVolumeClaim) WaitForBound

func (*TestPersistentVolumeClaim) WaitForPending

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) *TestPod

func NewTestPodWithName

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

func (*TestPod) Cleanup

func (t *TestPod) Cleanup()

func (*TestPod) Create

func (t *TestPod) Create()

func (*TestPod) Delete

func (t *TestPod) Delete()

func (*TestPod) DumpDbgInfoOff

func (t *TestPod) DumpDbgInfoOff()

func (*TestPod) DumpLogOff

func (t *TestPod) DumpLogOff()

func (*TestPod) Exec

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

func (*TestPod) Logs

func (t *TestPod) Logs()

func (*TestPod) SetNodeSelector

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

func (*TestPod) SetupVolume

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

func (*TestPod) WaitForFailure

func (t *TestPod) WaitForFailure()

func (*TestPod) WaitForRunning

func (t *TestPod) WaitForRunning()

func (*TestPod) WaitForRunningSlow

func (t *TestPod) WaitForRunningSlow()

func (*TestPod) WaitForSuccess

func (t *TestPod) WaitForSuccess()

type TestPreProvisionedPersistentVolume

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

func (*TestPreProvisionedPersistentVolume) Create

type TestSecret

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

func NewSecret

func NewSecret(c clientset.Interface, name, ns, iops, tags, encrypt, encryptKey, stype string) *TestSecret

func (*TestSecret) Cleanup

func (s *TestSecret) Cleanup()

func (*TestSecret) Create

func (s *TestSecret) Create()

type TestStatefulsets

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

func (*TestStatefulsets) Cleanup

func (t *TestStatefulsets) Cleanup()

func (*TestStatefulsets) Create

func (t *TestStatefulsets) Create()

func (*TestStatefulsets) Exec

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

func (*TestStatefulsets) Logs

func (t *TestStatefulsets) Logs()

func (*TestStatefulsets) WaitForPodReady

func (t *TestStatefulsets) 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) (*TestVolumeSnapshotClass, func())

func (*TestVolumeSnapshotClass) Cleanup

func (t *TestVolumeSnapshotClass) Cleanup()

func (*TestVolumeSnapshotClass) Create

func (t *TestVolumeSnapshotClass) Create()

func (*TestVolumeSnapshotClass) CreateSnapshot

func (*TestVolumeSnapshotClass) DeleteSnapshot

func (*TestVolumeSnapshotClass) ReadyToUse

func (t *TestVolumeSnapshotClass) ReadyToUse(snapshot *volumesnapshotv1.VolumeSnapshot, snapFail bool)

type VolumeDetails

type VolumeDetails struct {
	PVCName               string //PVC Name
	VolumeType            string //PVC SC
	FSType                string //Ext3 / XFS / EXT4
	Encrypted             bool
	MountOptions          []string
	ClaimSize             string //PVC Capacity
	ReclaimPolicy         *v1.PersistentVolumeReclaimPolicy
	VolumeBindingMode     *storagev1.VolumeBindingMode
	AllowedTopologyValues []string
	AccessMode            *v1.PersistentVolumeAccessMode
	VolumeMode            VolumeMode
	VolumeMount           VolumeMountDetails
	VolumeDevice          VolumeDeviceDetails

	DataSource *DataSource
	// contains filtered or unexported fields
}

func (*VolumeDetails) SetupDynamicPersistentVolumeClaim

func (volume *VolumeDetails) SetupDynamicPersistentVolumeClaim(client clientset.Interface, namespace *v1.Namespace, pvcErrExpected bool) (*TestPersistentVolumeClaim, []func())

type VolumeDeviceDetails

type VolumeDeviceDetails struct {
	NameGenerate string
}

type VolumeMode

type VolumeMode int
const (
	FileSystem VolumeMode = iota
	File
)

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