framework

package
v1.59.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 51 Imported by: 3

Documentation

Index

Constants

View Source
const (

	//NsPrefixLabel provides a cdi prefix label to identify the test namespace
	NsPrefixLabel = "cdi-e2e"
	//CdiPodPrefix provides the cdi-deployment pod prefix
	CdiPodPrefix = "cdi-deployment"
)
View Source
const (
	// DefaultNfsPvSize is the default nfs pv capacity
	DefaultNfsPvSize = "10Gi"

	// BiggerNfsPvSize is the bigger nfs pv capacity
	BiggerNfsPvSize = "20Gi"

	// ExtraNfsDiskPrefix is the prefix for extra nfs disks
	ExtraNfsDiskPrefix = "/extraDisk"
)

Variables

View Source
var (
	//NodeSelectorTestValue is nodeSelector value for test
	NodeSelectorTestValue = map[string]string{"kubernetes.io/arch": runtime.GOARCH}
	//TolerationsTestValue is tolerations value for test
	TolerationsTestValue = []v1.Toleration{{Key: "test", Value: "123"}}
	//AffinityTestValue is affinity value for test
	AffinityTestValue = &v1.Affinity{}
)
View Source
var (
	ClientsInstance = &Clients{}
)

run-time flags

Functions

func DeleteNS

func DeleteNS(c *kubernetes.Clientset, ns string) error

DeleteNS provides a function to delete the specified namespace from the test cluster

func GetKubeClientFromRESTConfig

func GetKubeClientFromRESTConfig(config *rest.Config) (*kubernetes.Clientset, error)

GetKubeClientFromRESTConfig provides a function to get a K8s client using hte REST config

func NfsPvDef added in v1.38.1

func NfsPvDef(index int, prefix, serviceIP, size string) *corev1.PersistentVolume

NfsPvDef creates pv defs for nfs

func VerifyPVCIsEmpty

func VerifyPVCIsEmpty(f *Framework, pvc *k8sv1.PersistentVolumeClaim, node string) (bool, error)

VerifyPVCIsEmpty verifies a passed in PVC is empty, returns true if the PVC is empty, false if it is not. Optionaly, specify node for the pod.

Types

type Clients added in v1.21.0

type Clients struct {
	KubectlPath    string
	OcPath         string
	CdiInstallNs   string
	KubeConfig     string
	KubeURL        string
	GoCLIPath      string
	SnapshotSCName string
	BlockSCName    string
	CsiCloneSCName string
	DockerPrefix   string
	DockerTag      string

	//  k8sClient provides our k8s client pointer
	K8sClient *kubernetes.Clientset
	// CdiClient provides our CDI client pointer
	CdiClient *cdiClientset.Clientset
	// ExtClient provides our CSI client pointer
	ExtClient *extclientset.Clientset
	// CrClient is a controller runtime client
	CrClient crclient.Client
	// RestConfig provides a pointer to our REST client config.
	RestConfig *rest.Config
	// DynamicClient performs generic operations on arbitrary k8s API objects.
	DynamicClient dynamic.Interface
}

Clients is the struct containing the client-go kubernetes clients

func (*Clients) Cdi added in v1.50.0

func (c *Clients) Cdi() *cdiClientset.Clientset

Cdi returns CDI Clientset

func (*Clients) GetCdiClient added in v1.21.0

func (c *Clients) GetCdiClient() (*cdiClientset.Clientset, error)

GetCdiClient gets an instance of a kubernetes client that includes all the CDI extensions.

func (*Clients) GetCrClient added in v1.21.0

func (c *Clients) GetCrClient() (crclient.Client, error)

GetCrClient returns a controller runtime client

func (*Clients) GetDynamicClient added in v1.35.0

func (c *Clients) GetDynamicClient() (dynamic.Interface, error)

GetDynamicClient gets an instance of a dynamic client that performs generic operations on arbitrary k8s API objects.

func (*Clients) GetExtClient added in v1.21.0

func (c *Clients) GetExtClient() (*extclientset.Clientset, error)

GetExtClient gets an instance of a kubernetes client that includes all the api extensions.

func (*Clients) GetKubeClient added in v1.21.0

func (c *Clients) GetKubeClient() (*kubernetes.Clientset, error)

GetKubeClient returns a Kubernetes rest client

func (*Clients) K8s added in v1.50.0

func (c *Clients) K8s() *kubernetes.Clientset

K8s returns Kubernetes Clientset

func (*Clients) LoadConfig added in v1.21.0

func (c *Clients) LoadConfig() (*rest.Config, error)

LoadConfig loads our specified kubeconfig

type Config

type Config struct {
	// SkipNamespaceCreation sets whether to skip creating a namespace. Use this ONLY for tests that do not require
	// a namespace at all, like basic sanity or other global tests.
	SkipNamespaceCreation bool

	// FeatureGates may be overridden for a framework
	FeatureGates []string
}

Config provides some basic test config options

type ExecOptions

type ExecOptions struct {
	Command []string

	Namespace     string
	PodName       string
	ContainerName string

	Stdin         io.Reader
	CaptureStdout bool
	CaptureStderr bool
	// If false, whitespace in std{err,out} will be removed.
	PreserveWhitespace bool
}

ExecOptions passed to ExecWithOptions

type Framework

type Framework struct {
	Config
	// NsPrefix is a prefix for generated namespace
	NsPrefix string
	// Namespace provides a namespace for each test generated/unique ns per test
	Namespace *v1.Namespace
	// Namespace2 provides an additional generated/unique secondary ns for testing across namespaces (eg. clone tests)
	Namespace2 *v1.Namespace // note: not instantiated in NewFramework

	// ControllerPod provides a pointer to our test controller pod
	ControllerPod *v1.Pod

	*Clients
	// contains filtered or unexported fields
}

Framework supports common operations used by functional/e2e tests. It holds the k8s and cdi clients, a generated unique namespace, run-time flags, and more fields will be added over time as cdi e2e evolves. Global BeforeEach and AfterEach are called in the Framework constructor.

func NewFramework

func NewFramework(prefix string, config ...Config) *Framework

NewFramework calls NewFramework and handles errors by calling Fail. Config is optional, but if passed there can only be one. To understand the order in which things are run, read http://onsi.github.io/ginkgo/#understanding-ginkgos-lifecycle flag parsing happens AFTER ginkgo has constructed the entire testing tree. So anything that uses information from flags cannot work when called during test tree construction.

func (*Framework) AddNamespaceToDelete

func (f *Framework) AddNamespaceToDelete(ns *v1.Namespace)

AddNamespaceToDelete provides a wrapper around the go append function

func (*Framework) AfterEach

func (f *Framework) AfterEach()

AfterEach provides a set of operations to run after each test

func (*Framework) BeforeEach

func (f *Framework) BeforeEach()

BeforeEach provides a set of operations to run before each test

func (*Framework) CreateAndPopulateSourcePVC

func (f *Framework) CreateAndPopulateSourcePVC(pvcDef *k8sv1.PersistentVolumeClaim, podName string, fillCommand string) *k8sv1.PersistentVolumeClaim

CreateAndPopulateSourcePVC Creates and populates a PVC using the provided POD and command

func (*Framework) CreateBoundPVCFromDefinition added in v1.21.0

func (f *Framework) CreateBoundPVCFromDefinition(def *k8sv1.PersistentVolumeClaim) *k8sv1.PersistentVolumeClaim

CreateBoundPVCFromDefinition is a wrapper around utils.CreatePVCFromDefinition that also force binds pvc on on WaitForFirstConsumer storage class by executing f.ForceBindIfWaitForFirstConsumer(pvc)

func (*Framework) CreateConsumerPod added in v1.57.0

func (f *Framework) CreateConsumerPod(targetPvc *k8sv1.PersistentVolumeClaim) *k8sv1.Pod

CreateConsumerPod create a pod that consumes the given PVC

func (*Framework) CreateExecutorPodWithPVC

func (f *Framework) CreateExecutorPodWithPVC(podName, namespace string, pvc *k8sv1.PersistentVolumeClaim, readOnly bool) (*k8sv1.Pod, error)

CreateExecutorPodWithPVC creates a Pod with the passed in PVC mounted under /dev/pvc. You can then use the executor utilities to run commands against the PVC through this Pod.

func (*Framework) CreateExecutorPodWithPVCSpecificNode added in v1.10.7

func (f *Framework) CreateExecutorPodWithPVCSpecificNode(podName, namespace string, pvc *k8sv1.PersistentVolumeClaim, node string, readOnly bool) (*k8sv1.Pod, error)

CreateExecutorPodWithPVCSpecificNode creates a Pod on a specific node with the passed in PVC mounted under /dev/pvc. You can then use the executor utilities to run commands against the PVC through this Pod.

func (*Framework) CreateKubectlCommand added in v1.52.0

func (f *Framework) CreateKubectlCommand(args ...string) *exec.Cmd

CreateKubectlCommand returns the Cmd to execute kubectl

func (*Framework) CreateNamespace

func (f *Framework) CreateNamespace(prefix string, labels map[string]string) (*v1.Namespace, error)

CreateNamespace instantiates a new namespace object with a unique name and the passed-in label(s).

func (*Framework) CreateNonDefaultVariationOfStorageClass added in v1.58.0

func (f *Framework) CreateNonDefaultVariationOfStorageClass(sc *storagev1.StorageClass, mutationFunc func(*storagev1.StorageClass)) (*storagev1.StorageClass, error)

CreateNonDefaultVariationOfStorageClass creates a variation of a storage class following mutationFunc's changes

func (*Framework) CreateNoopPodWithPVC added in v1.27.0

func (f *Framework) CreateNoopPodWithPVC(podName, namespace string, pvc *k8sv1.PersistentVolumeClaim) (*k8sv1.Pod, error)

CreateNoopPodWithPVC creates a short living pod, that might be used to force bind a pvc

func (*Framework) CreatePVCFromDefinition

func (f *Framework) CreatePVCFromDefinition(def *k8sv1.PersistentVolumeClaim) (*k8sv1.PersistentVolumeClaim, error)

CreatePVCFromDefinition is a wrapper around utils.CreatePVCFromDefinition

func (*Framework) CreatePVFromDefinition added in v1.5.0

func (f *Framework) CreatePVFromDefinition(def *k8sv1.PersistentVolume) (*k8sv1.PersistentVolume, error)

CreatePVFromDefinition is a wrapper around utils.CreatePVFromDefinition

func (*Framework) CreatePod

func (f *Framework) CreatePod(podDef *k8sv1.Pod) (*k8sv1.Pod, error)

CreatePod is a wrapper around utils.CreatePod

func (*Framework) CreatePrometheusServiceInNs added in v1.4.0

func (f *Framework) CreatePrometheusServiceInNs(namespace string) (*v1.Service, error)

CreatePrometheusServiceInNs creates a service for prometheus in the specified namespace. This allows us to test for prometheus end points using the service to connect to the endpoints.

func (*Framework) CreateQuotaInNs added in v1.14.0

func (f *Framework) CreateQuotaInNs(requestCPU, requestMemory, limitsCPU, limitsMemory int64) error

CreateQuotaInNs creates a quota and sets it on the current test namespace.

func (*Framework) CreateQuotaInSpecifiedNs added in v1.24.0

func (f *Framework) CreateQuotaInSpecifiedNs(ns string, requestCPU, requestMemory, limitsCPU, limitsMemory int64) error

CreateQuotaInSpecifiedNs creates a quota and sets it on the specified test namespace.

func (*Framework) CreateScheduledPVCFromDefinition added in v1.57.0

func (f *Framework) CreateScheduledPVCFromDefinition(def *k8sv1.PersistentVolumeClaim) *k8sv1.PersistentVolumeClaim

CreateScheduledPVCFromDefinition is a wrapper around utils.CreatePVCFromDefinition that also triggeres the scheduler to dynamically provision a pvc with WaitForFirstConsumer storage class by executing f.ForceBindIfWaitForFirstConsumer(pvc)

func (*Framework) CreateStorageQuota added in v1.42.0

func (f *Framework) CreateStorageQuota(numPVCs, requestStorage int64) error

CreateStorageQuota creates a quota to limit pvc count and cumulative storage capacity

func (*Framework) CreateVddkWarmImportDataVolume added in v1.52.0

func (f *Framework) CreateVddkWarmImportDataVolume(dataVolumeName, size, url string) *cdiv1.DataVolume

CreateVddkWarmImportDataVolume fetches snapshot information from vcsim and returns a multi-stage VDDK data volume

func (*Framework) CreateVddkWarmImportPopulatorSource added in v1.58.0

func (f *Framework) CreateVddkWarmImportPopulatorSource(volumeImportName, pvcName, url string) *cdiv1.VolumeImportSource

CreateVddkWarmImportPopulatorSource fetches snapshot information from vcsim and returns a multi-stage VDDK volumeImportSource

func (*Framework) CreateVerifierPodWithPVC added in v1.27.0

func (f *Framework) CreateVerifierPodWithPVC(namespace string, pvc *k8sv1.PersistentVolumeClaim) (*k8sv1.Pod, error)

CreateVerifierPodWithPVC creates a Pod called verifier, with the passed in PVC mounted under /dev/pvc. You can then use the executor utilities to run commands against the PVC through this Pod.

func (*Framework) CreateWFFCVariationOfStorageClass added in v1.53.1

func (f *Framework) CreateWFFCVariationOfStorageClass(sc *storagev1.StorageClass) (*storagev1.StorageClass, error)

CreateWFFCVariationOfStorageClass creates a WFFC variation of a storage class

func (*Framework) DeletePVC

func (f *Framework) DeletePVC(pvc *k8sv1.PersistentVolumeClaim) error

DeletePVC is a wrapper around utils.DeletePVC

func (*Framework) DeletePod

func (f *Framework) DeletePod(pod *k8sv1.Pod) error

DeletePod is a wrapper around utils.DeletePod

func (*Framework) DeleteStorageQuota added in v1.42.0

func (f *Framework) DeleteStorageQuota() error

DeleteStorageQuota an existing storage quota in the current test namespace.

func (*Framework) ExecCommandInContainer

func (f *Framework) ExecCommandInContainer(namespace, podName, containerName string, cmd ...string) (string, string, error)

ExecCommandInContainer executes a command in the specified container.

func (*Framework) ExecCommandInContainerWithFullOutput

func (f *Framework) ExecCommandInContainerWithFullOutput(namespace, podName, containerName string, cmd ...string) (string, string, error)

ExecCommandInContainerWithFullOutput executes a command in the specified container and return stdout, stderr and error

func (*Framework) ExecCommandInPod

func (f *Framework) ExecCommandInPod(podName, namespace string, cmd ...string) (string, string, error)

ExecCommandInPod provides a function to execute a command on a running pod

func (*Framework) ExecCommandInPodWithFullOutput

func (f *Framework) ExecCommandInPodWithFullOutput(namespace, podName string, cmd ...string) (string, string, error)

ExecCommandInPodWithFullOutput provides a function to execute a command in a running pod and to capture its output

func (*Framework) ExecShellInContainer

func (f *Framework) ExecShellInContainer(namespace, podName, containerName string, cmd string) (string, string, error)

ExecShellInContainer provides a function to execute a shell cmd for the specified running container in a pod

func (*Framework) ExecShellInPod

func (f *Framework) ExecShellInPod(podName, namespace string, cmd string) (string, string, error)

ExecShellInPod provides a function to execute a shell cmd in the specified pod

func (*Framework) ExecShellInPodWithFullOutput

func (f *Framework) ExecShellInPodWithFullOutput(namespace, podName string, cmd string) (string, string, error)

ExecShellInPodWithFullOutput provides a function to execute a shell cmd in a running pod and to capture its output

func (*Framework) ExecWithOptions

func (f *Framework) ExecWithOptions(options ExecOptions) (string, string, error)

ExecWithOptions executes a command in the specified container, returning stdout, stderr and error. `options` allowed for additional parameters to be passed.

func (*Framework) ExpectCloneFallback added in v1.57.0

func (f *Framework) ExpectCloneFallback(pvc *v1.PersistentVolumeClaim, reason, message string)

ExpectCloneFallback checks PVC annotations and event of clone fallback to host-assisted

func (*Framework) ExpectEvent added in v1.52.0

func (f *Framework) ExpectEvent(dataVolumeNamespace string) gomega.AsyncAssertion

ExpectEvent polls and fetches events during a defined period of time

func (*Framework) FindPVC

func (f *Framework) FindPVC(pvcName string) (*k8sv1.PersistentVolumeClaim, error)

FindPVC is a wrapper around utils.FindPVC

func (*Framework) FindPodByPrefix

func (f *Framework) FindPodByPrefix(prefix string) (*k8sv1.Pod, error)

FindPodByPrefix is a wrapper around utils.FindPodByPrefix

func (*Framework) FindPodBySuffix added in v1.14.0

func (f *Framework) FindPodBySuffix(suffix string) (*k8sv1.Pod, error)

FindPodBySuffix is a wrapper around utils.FindPodBySuffix

func (*Framework) ForceBindIfWaitForFirstConsumer added in v1.21.0

func (f *Framework) ForceBindIfWaitForFirstConsumer(targetPvc *k8sv1.PersistentVolumeClaim)

ForceBindIfWaitForFirstConsumer creates a Pod with the passed in PVC mounted under /dev/pvc, which forces the PVC to be scheduled and bound.

func (*Framework) ForceBindPvcIfDvIsWaitForFirstConsumer added in v1.21.0

func (f *Framework) ForceBindPvcIfDvIsWaitForFirstConsumer(dv *cdiv1.DataVolume)

ForceBindPvcIfDvIsWaitForFirstConsumer creates a Pod with the PVC for passed in DV mounted under /dev/pvc, which forces the PVC to be scheduled and bound.

func (*Framework) ForceSchedulingIfWaitForFirstConsumerPopulationPVC added in v1.57.0

func (f *Framework) ForceSchedulingIfWaitForFirstConsumerPopulationPVC(targetPvc *k8sv1.PersistentVolumeClaim)

ForceSchedulingIfWaitForFirstConsumerPopulationPVC creates a Pod with the passed in PVC mounted under /dev/pvc, which forces the PVC to be scheduled for provisioning.

func (*Framework) GetCdiClientForServiceAccount added in v1.9.4

func (f *Framework) GetCdiClientForServiceAccount(namespace, name string) (*cdiClientset.Clientset, error)

GetCdiClientForServiceAccount returns a cdi client for a service account

func (*Framework) GetDiskGroup added in v1.15.0

func (f *Framework) GetDiskGroup(namespace *k8sv1.Namespace, pvc *k8sv1.PersistentVolumeClaim, deletePod bool) (string, error)

GetDiskGroup returns the group of a disk image.

func (*Framework) GetEnvVarValue added in v1.57.0

func (f *Framework) GetEnvVarValue(name string) (importerImage string)

GetEnvVarValue gets an environmemnt variable value from the cdi-deployment container

func (*Framework) GetImageContentSize added in v1.43.3

func (f *Framework) GetImageContentSize(namespace *k8sv1.Namespace, pvc *k8sv1.PersistentVolumeClaim, imagePath string, imageSize *int64) error

GetImageContentSize returns the content size (as opposed to size on disk) of an image

func (*Framework) GetImageInfo added in v1.34.0

func (f *Framework) GetImageInfo(namespace *k8sv1.Namespace, pvc *k8sv1.PersistentVolumeClaim, imagePath string, info *image.ImgInfo) error

GetImageInfo returns qemu-img information about given image

func (*Framework) GetMD5 added in v1.9.4

func (f *Framework) GetMD5(namespace *k8sv1.Namespace, pvc *k8sv1.PersistentVolumeClaim, fileName string, numBytes int64) (string, error)

GetMD5 returns the MD5 of a file on a PVC

func (*Framework) GetNoSnapshotStorageClass added in v1.57.0

func (f *Framework) GetNoSnapshotStorageClass() *string

GetNoSnapshotStorageClass gets storage class without snapshot support

func (*Framework) GetRESTConfigForServiceAccount added in v1.26.0

func (f *Framework) GetRESTConfigForServiceAccount(namespace, name string) (*rest.Config, error)

GetRESTConfigForServiceAccount returns a RESTConfig for SA

func (*Framework) GetSnapshotClass added in v1.56.0

func (f *Framework) GetSnapshotClass() *snapshotv1.VolumeSnapshotClass

GetSnapshotClass returns the volume snapshot class.

func (*Framework) GetTokenForServiceAccount added in v1.51.0

func (f *Framework) GetTokenForServiceAccount(namespace, name string) (string, error)

GetTokenForServiceAccount returns a token for a given SA

func (*Framework) IsBindingModeWaitForFirstConsumer added in v1.21.0

func (f *Framework) IsBindingModeWaitForFirstConsumer(storageClassName *string) bool

IsBindingModeWaitForFirstConsumer checks if the storage class with specified name has the VolumeBindingMode set to WaitForFirstConsumer

func (*Framework) IsBlockVolumeStorageClassAvailable added in v1.10.0

func (f *Framework) IsBlockVolumeStorageClassAvailable() bool

IsBlockVolumeStorageClassAvailable checks if the block volume storage class exists.

func (*Framework) IsCSIVolumeCloneStorageClassAvailable added in v1.38.0

func (f *Framework) IsCSIVolumeCloneStorageClassAvailable() bool

IsCSIVolumeCloneStorageClassAvailable checks if the storage class capable of CSI Volume Cloning exists.

func (*Framework) IsPrometheusAvailable added in v1.52.0

func (f *Framework) IsPrometheusAvailable() bool

IsPrometheusAvailable decides whether or not we will run prometheus alert/metric tests

func (*Framework) IsSnapshotStorageClassAvailable added in v1.10.0

func (f *Framework) IsSnapshotStorageClassAvailable() bool

IsSnapshotStorageClassAvailable checks if the snapshot storage class exists.

func (*Framework) MakePrometheusHTTPRequest added in v1.52.0

func (f *Framework) MakePrometheusHTTPRequest(endpoint string) *http.Response

MakePrometheusHTTPRequest makes a request to the prometheus api and returns the response

func (*Framework) NewPodWithPVC added in v1.27.0

func (f *Framework) NewPodWithPVC(podName, cmd string, pvc *k8sv1.PersistentVolumeClaim, readOnly bool) *k8sv1.Pod

NewPodWithPVC creates a new pod that mounts the given PVC

func (*Framework) PopulatePVC added in v1.57.0

func (f *Framework) PopulatePVC(pvc *k8sv1.PersistentVolumeClaim, podName string, fillCommand string)

PopulatePVC populates a PVC using a pod with the provided pod name and command

func (*Framework) PrintControllerLog added in v1.52.0

func (f *Framework) PrintControllerLog()

PrintControllerLog ...

func (*Framework) PrintPodLog added in v1.52.0

func (f *Framework) PrintPodLog(podName, namespace string)

PrintPodLog ...

func (*Framework) RunCommandAndCaptureOutput added in v1.7.0

func (f *Framework) RunCommandAndCaptureOutput(pvc *k8sv1.PersistentVolumeClaim, cmd string, readOnly bool) (string, error)

RunCommandAndCaptureOutput runs a command on a pod that has the passed in PVC mounted and captures the output.

func (*Framework) RunKubectlCommand added in v1.52.0

func (f *Framework) RunKubectlCommand(args ...string) (string, error)

RunKubectlCommand runs a kubectl Cmd and returns output and err

func (*Framework) TestNodePlacementValues added in v1.52.0

func (f *Framework) TestNodePlacementValues() sdkapi.NodePlacement

TestNodePlacementValues returns a pre-defined set of node placement values for testing purposes. The values chosen are valid, but the pod will likely not be schedulable.

func (*Framework) UpdateCdiConfigResourceLimits added in v1.14.0

func (f *Framework) UpdateCdiConfigResourceLimits(resourceCPU, resourceMemory, limitsCPU, limitsMemory int64) error

UpdateCdiConfigResourceLimits sets the limits in the CDIConfig object

func (*Framework) UpdateQuotaInNs added in v1.14.0

func (f *Framework) UpdateQuotaInNs(requestCPU, requestMemory, limitsCPU, limitsMemory int64) error

UpdateQuotaInNs updates an existing quota in the current test namespace.

func (*Framework) UpdateStorageQuota added in v1.42.0

func (f *Framework) UpdateStorageQuota(numPVCs, requestStorage int64) error

UpdateStorageQuota updates an existing storage quota in the current test namespace.

func (*Framework) VerifyBlankDisk added in v1.10.5

func (f *Framework) VerifyBlankDisk(namespace *k8sv1.Namespace, pvc *k8sv1.PersistentVolumeClaim) (bool, error)

VerifyBlankDisk checks a blank disk on a file mode PVC by validating that the disk.img file is sparse.

func (*Framework) VerifyFSOverhead added in v1.32.0

func (f *Framework) VerifyFSOverhead(namespace *k8sv1.Namespace, pvc *k8sv1.PersistentVolumeClaim, preallocation bool) (bool, error)

VerifyFSOverhead checks whether virtual size is smaller than actual size. That means FS Overhead has been accounted for. NOTE: this assertion is only valid when preallocation is used.

func (*Framework) VerifyImagePreallocated added in v1.34.0

func (f *Framework) VerifyImagePreallocated(namespace *k8sv1.Namespace, pvc *k8sv1.PersistentVolumeClaim) (bool, error)

VerifyImagePreallocated checks that image's virtual size is roughly equal to actual size

func (*Framework) VerifyPermissions added in v1.19.0

func (f *Framework) VerifyPermissions(namespace *k8sv1.Namespace, pvc *k8sv1.PersistentVolumeClaim) (bool, error)

VerifyPermissions returns the group of a disk image.

func (*Framework) VerifySparse added in v1.13.2

func (f *Framework) VerifySparse(namespace *k8sv1.Namespace, pvc *k8sv1.PersistentVolumeClaim, imagePath string) (bool, error)

VerifySparse checks a disk image being sparse after creation/resize.

func (*Framework) VerifyTargetPVCArchiveContent added in v1.10.0

func (f *Framework) VerifyTargetPVCArchiveContent(namespace *k8sv1.Namespace, pvc *k8sv1.PersistentVolumeClaim, count string) (bool, error)

VerifyTargetPVCArchiveContent provides a function to check if the number of files extracted from an archive matches the passed in value

func (*Framework) VerifyTargetPVCContentMD5

func (f *Framework) VerifyTargetPVCContentMD5(namespace *k8sv1.Namespace, pvc *k8sv1.PersistentVolumeClaim, fileName string, expectedHash string, numBytes ...int64) (bool, error)

VerifyTargetPVCContentMD5 provides a function to check the md5 of data on a PVC and ensure it matches that which is provided

func (*Framework) WaitForPersistentVolumeClaimPhase

func (f *Framework) WaitForPersistentVolumeClaimPhase(phase k8sv1.PersistentVolumeClaimPhase, pvcName string) error

WaitForPersistentVolumeClaimPhase is a wrapper around utils.WaitForPersistentVolumeClaimPhase

func (*Framework) WaitPVCDeletedByUID added in v1.20.0

func (f *Framework) WaitPVCDeletedByUID(pvcSpec *k8sv1.PersistentVolumeClaim, timeout time.Duration) (bool, error)

WaitPVCDeletedByUID is a wrapper around utils.WaitPVCDeletedByUID

func (*Framework) WaitTimeoutForPVReady added in v1.5.0

func (f *Framework) WaitTimeoutForPVReady(pvName string, timeout time.Duration) error

WaitTimeoutForPVReady is a wrapper around utils.WaitTimeouotForPVReady

func (*Framework) WaitTimeoutForPodReady

func (f *Framework) WaitTimeoutForPodReady(podName string, timeout time.Duration) error

WaitTimeoutForPodReady is a wrapper around utils.WaitTimeouotForPodReady

func (*Framework) WaitTimeoutForPodStatus

func (f *Framework) WaitTimeoutForPodStatus(podName string, status k8sv1.PodPhase, timeout time.Duration) error

WaitTimeoutForPodStatus is a wrapper around utils.WaitTimeouotForPodStatus

Jump to

Keyboard shortcuts

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