Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteNS(c *kubernetes.Clientset, ns string) error
- func GetKubeClientFromRESTConfig(config *rest.Config) (*kubernetes.Clientset, error)
- func NfsPvDef(index int, prefix, serviceIP, size string) *corev1.PersistentVolume
- func VerifyPVCIsEmpty(f *Framework, pvc *k8sv1.PersistentVolumeClaim, node string) (bool, error)
- type Clients
- func (c *Clients) Cdi() *cdiClientset.Clientset
- func (c *Clients) GetCdiClient() (*cdiClientset.Clientset, error)
- func (c *Clients) GetCrClient() (crclient.Client, error)
- func (c *Clients) GetDynamicClient() (dynamic.Interface, error)
- func (c *Clients) GetExtClient() (*extclientset.Clientset, error)
- func (c *Clients) GetKubeClient() (*kubernetes.Clientset, error)
- func (c *Clients) K8s() *kubernetes.Clientset
- func (c *Clients) LoadConfig() (*rest.Config, error)
- type Config
- type ExecOptions
- type Framework
- func (f *Framework) AddNamespaceToDelete(ns *v1.Namespace)
- func (f *Framework) AfterEach()
- func (f *Framework) BeforeEach()
- func (f *Framework) CreateAndPopulateSourcePVC(pvcDef *k8sv1.PersistentVolumeClaim, podName string, fillCommand string) *k8sv1.PersistentVolumeClaim
- func (f *Framework) CreateBoundPVCFromDefinition(def *k8sv1.PersistentVolumeClaim) *k8sv1.PersistentVolumeClaim
- func (f *Framework) CreateExecutorPodWithPVC(podName, namespace string, pvc *k8sv1.PersistentVolumeClaim) (*k8sv1.Pod, error)
- func (f *Framework) CreateExecutorPodWithPVCSpecificNode(podName, namespace string, pvc *k8sv1.PersistentVolumeClaim, node string) (*k8sv1.Pod, error)
- func (f *Framework) CreateKubectlCommand(args ...string) *exec.Cmd
- func (f *Framework) CreateNamespace(prefix string, labels map[string]string) (*v1.Namespace, error)
- func (f *Framework) CreateNoopPodWithPVC(podName, namespace string, pvc *k8sv1.PersistentVolumeClaim) (*k8sv1.Pod, error)
- func (f *Framework) CreatePVCFromDefinition(def *k8sv1.PersistentVolumeClaim) (*k8sv1.PersistentVolumeClaim, error)
- func (f *Framework) CreatePVFromDefinition(def *k8sv1.PersistentVolume) (*k8sv1.PersistentVolume, error)
- func (f *Framework) CreatePod(podDef *k8sv1.Pod) (*k8sv1.Pod, error)
- func (f *Framework) CreatePrometheusServiceInNs(namespace string) (*v1.Service, error)
- func (f *Framework) CreateQuotaInNs(requestCPU, requestMemory, limitsCPU, limitsMemory int64) error
- func (f *Framework) CreateQuotaInSpecifiedNs(ns string, requestCPU, requestMemory, limitsCPU, limitsMemory int64) error
- func (f *Framework) CreateStorageQuota(numPVCs, requestStorage int64) error
- func (f *Framework) CreateVariationOfStorageClass(sc *storagev1.StorageClass, mutationFunc func(*storagev1.StorageClass)) (*storagev1.StorageClass, error)
- func (f *Framework) CreateVddkWarmImportDataVolume(dataVolumeName, size, url string) *cdiv1.DataVolume
- func (f *Framework) CreateVerifierPodWithPVC(namespace string, pvc *k8sv1.PersistentVolumeClaim) (*k8sv1.Pod, error)
- func (f *Framework) CreateWFFCVariationOfStorageClass(sc *storagev1.StorageClass) (*storagev1.StorageClass, error)
- func (f *Framework) DeletePVC(pvc *k8sv1.PersistentVolumeClaim) error
- func (f *Framework) DeletePod(pod *k8sv1.Pod) error
- func (f *Framework) DeleteStorageQuota() error
- func (f *Framework) ExecCommandInContainer(namespace, podName, containerName string, cmd ...string) (string, string, error)
- func (f *Framework) ExecCommandInContainerWithFullOutput(namespace, podName, containerName string, cmd ...string) (string, string, error)
- func (f *Framework) ExecCommandInPod(podName, namespace string, cmd ...string) (string, string, error)
- func (f *Framework) ExecCommandInPodWithFullOutput(namespace, podName string, cmd ...string) (string, string, error)
- func (f *Framework) ExecShellInContainer(namespace, podName, containerName string, cmd string) (string, string, error)
- func (f *Framework) ExecShellInPod(podName, namespace string, cmd string) (string, string, error)
- func (f *Framework) ExecShellInPodWithFullOutput(namespace, podName string, cmd string) (string, string, error)
- func (f *Framework) ExecWithOptions(options ExecOptions) (string, string, error)
- func (f *Framework) ExpectEvent(dataVolumeNamespace string) gomega.AsyncAssertion
- func (f *Framework) FindPVC(pvcName string) (*k8sv1.PersistentVolumeClaim, error)
- func (f *Framework) FindPodByPrefix(prefix string) (*k8sv1.Pod, error)
- func (f *Framework) FindPodBySuffix(suffix string) (*k8sv1.Pod, error)
- func (f *Framework) ForceBindIfWaitForFirstConsumer(targetPvc *k8sv1.PersistentVolumeClaim)
- func (f *Framework) ForceBindPvcIfDvIsWaitForFirstConsumer(dv *cdiv1.DataVolume)
- func (f *Framework) GetCdiClientForServiceAccount(namespace, name string) (*cdiClientset.Clientset, error)
- func (f *Framework) GetDiskGroup(namespace *k8sv1.Namespace, pvc *k8sv1.PersistentVolumeClaim, deletePod bool) (string, error)
- func (f *Framework) GetImageContentSize(namespace *k8sv1.Namespace, pvc *k8sv1.PersistentVolumeClaim, imagePath string, ...) error
- func (f *Framework) GetImageInfo(namespace *k8sv1.Namespace, pvc *k8sv1.PersistentVolumeClaim, imagePath string, ...) error
- func (f *Framework) GetMD5(namespace *k8sv1.Namespace, pvc *k8sv1.PersistentVolumeClaim, fileName string, ...) (string, error)
- func (f *Framework) GetRESTConfigForServiceAccount(namespace, name string) (*rest.Config, error)
- func (f *Framework) GetSnapshotClass() *snapshotv1.VolumeSnapshotClass
- func (f *Framework) GetTokenForServiceAccount(namespace, name string) (string, error)
- func (f *Framework) IsBindingModeWaitForFirstConsumer(storageClassName *string) bool
- func (f *Framework) IsBlockVolumeStorageClassAvailable() bool
- func (f *Framework) IsCSIVolumeCloneStorageClassAvailable() bool
- func (f *Framework) IsPrometheusAvailable() bool
- func (f *Framework) IsSnapshotStorageClassAvailable() bool
- func (f *Framework) MakePrometheusHTTPRequest(endpoint string) *http.Response
- func (f *Framework) NewPodWithPVC(podName, cmd string, pvc *k8sv1.PersistentVolumeClaim) *k8sv1.Pod
- func (f *Framework) PodSpecHasTestNodePlacementValues(podSpec v1.PodSpec) bool
- func (f *Framework) PrintControllerLog()
- func (f *Framework) PrintPodLog(podName, namespace string)
- func (f *Framework) RunCommandAndCaptureOutput(pvc *k8sv1.PersistentVolumeClaim, cmd string) (string, error)
- func (f *Framework) RunKubectlCommand(args ...string) (string, error)
- func (f *Framework) TestNodePlacementValues() sdkapi.NodePlacement
- func (f *Framework) UpdateCdiConfigResourceLimits(resourceCPU, resourceMemory, limitsCPU, limitsMemory int64) error
- func (f *Framework) UpdateQuotaInNs(requestCPU, requestMemory, limitsCPU, limitsMemory int64) error
- func (f *Framework) UpdateStorageQuota(numPVCs, requestStorage int64) error
- func (f *Framework) VerifyBlankDisk(namespace *k8sv1.Namespace, pvc *k8sv1.PersistentVolumeClaim) (bool, error)
- func (f *Framework) VerifyFSOverhead(namespace *k8sv1.Namespace, pvc *k8sv1.PersistentVolumeClaim, ...) (bool, error)
- func (f *Framework) VerifyImagePreallocated(namespace *k8sv1.Namespace, pvc *k8sv1.PersistentVolumeClaim) (bool, error)
- func (f *Framework) VerifyPermissions(namespace *k8sv1.Namespace, pvc *k8sv1.PersistentVolumeClaim) (bool, error)
- func (f *Framework) VerifySparse(namespace *k8sv1.Namespace, pvc *k8sv1.PersistentVolumeClaim, imagePath string) (bool, error)
- func (f *Framework) VerifyTargetPVCArchiveContent(namespace *k8sv1.Namespace, pvc *k8sv1.PersistentVolumeClaim, count string) (bool, error)
- func (f *Framework) VerifyTargetPVCContentMD5(namespace *k8sv1.Namespace, pvc *k8sv1.PersistentVolumeClaim, fileName string, ...) (bool, error)
- func (f *Framework) WaitForPersistentVolumeClaimPhase(phase k8sv1.PersistentVolumeClaimPhase, pvcName string) error
- func (f *Framework) WaitPVCDeletedByUID(pvcSpec *k8sv1.PersistentVolumeClaim, timeout time.Duration) (bool, error)
- func (f *Framework) WaitTimeoutForPVReady(pvName string, timeout time.Duration) error
- func (f *Framework) WaitTimeoutForPodReady(podName string, timeout time.Duration) error
- func (f *Framework) WaitTimeoutForPodStatus(podName string, status k8sv1.PodPhase, timeout time.Duration) error
- type KubernetesReporter
Constants ¶
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" )
const (
//NsPrefixLabel provides a cdi prefix label to identify the test namespace
NsPrefixLabel = "cdi-e2e"
)
Variables ¶
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 ¶
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
GetCrClient returns a controller runtime client
func (*Clients) GetDynamicClient ¶ added in v1.35.0
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
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 ¶
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 ¶
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) CreateExecutorPodWithPVC ¶
func (f *Framework) CreateExecutorPodWithPVC(podName, namespace string, pvc *k8sv1.PersistentVolumeClaim) (*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) (*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
CreateKubectlCommand returns the Cmd to execute kubectl
func (*Framework) CreateNamespace ¶
CreateNamespace instantiates a new namespace object with a unique name and the passed-in label(s).
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) CreatePrometheusServiceInNs ¶ added in v1.4.0
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
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) CreateStorageQuota ¶ added in v1.42.0
CreateStorageQuota creates a quota to limit pvc count and cumulative storage capacity
func (*Framework) CreateVariationOfStorageClass ¶ added in v1.56.0
func (f *Framework) CreateVariationOfStorageClass(sc *storagev1.StorageClass, mutationFunc func(*storagev1.StorageClass)) (*storagev1.StorageClass, error)
CreateVariationOfStorageClass creates a variation of a storage class following mutationFunc's changes
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) 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) DeleteStorageQuota ¶ added in v1.42.0
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 ¶
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) 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 ¶
FindPodByPrefix is a wrapper around utils.FindPodByPrefix
func (*Framework) FindPodBySuffix ¶ added in v1.14.0
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) 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) 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) GetRESTConfigForServiceAccount ¶ added in v1.26.0
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
GetTokenForServiceAccount returns a token for a given SA
func (*Framework) IsBindingModeWaitForFirstConsumer ¶ added in v1.21.0
IsBindingModeWaitForFirstConsumer checks if the storage class with specified name has the VolumeBindingMode set to WaitForFirstConsumer
func (*Framework) IsBlockVolumeStorageClassAvailable ¶ added in v1.10.0
IsBlockVolumeStorageClassAvailable checks if the block volume storage class exists.
func (*Framework) IsCSIVolumeCloneStorageClassAvailable ¶ added in v1.38.0
IsCSIVolumeCloneStorageClassAvailable checks if the storage class capable of CSI Volume Cloning exists.
func (*Framework) IsPrometheusAvailable ¶ added in v1.52.0
IsPrometheusAvailable decides whether or not we will run prometheus alert/metric tests
func (*Framework) IsSnapshotStorageClassAvailable ¶ added in v1.10.0
IsSnapshotStorageClassAvailable checks if the snapshot storage class exists.
func (*Framework) MakePrometheusHTTPRequest ¶ added in v1.52.0
MakePrometheusHTTPRequest makes a request to the prometheus api and returns the response
func (*Framework) NewPodWithPVC ¶ added in v1.27.0
NewPodWithPVC creates a new pod that mounts the given PVC
func (*Framework) PodSpecHasTestNodePlacementValues ¶ added in v1.52.0
PodSpecHasTestNodePlacementValues compares if the pod spec has the set of node placement values defined for testing purposes
func (*Framework) PrintControllerLog ¶ added in v1.52.0
func (f *Framework) PrintControllerLog()
PrintControllerLog ...
func (*Framework) PrintPodLog ¶ added in v1.52.0
PrintPodLog ...
func (*Framework) RunCommandAndCaptureOutput ¶ added in v1.7.0
func (f *Framework) RunCommandAndCaptureOutput(pvc *k8sv1.PersistentVolumeClaim, cmd string) (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
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
UpdateQuotaInNs updates an existing quota in the current test namespace.
func (*Framework) UpdateStorageQuota ¶ added in v1.42.0
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
WaitTimeoutForPVReady is a wrapper around utils.WaitTimeouotForPVReady
func (*Framework) WaitTimeoutForPodReady ¶
WaitTimeoutForPodReady is a wrapper around utils.WaitTimeouotForPodReady
type KubernetesReporter ¶ added in v1.12.0
type KubernetesReporter struct { FailureCount int // contains filtered or unexported fields }
KubernetesReporter is the struct that holds the report info.
func NewKubernetesReporter ¶ added in v1.12.0
func NewKubernetesReporter() *KubernetesReporter
NewKubernetesReporter creates a new instance of the reporter.
func (*KubernetesReporter) Cleanup ¶ added in v1.12.0
func (r *KubernetesReporter) Cleanup()
Cleanup cleans up the current content of the artifactsDir
func (*KubernetesReporter) Dump ¶ added in v1.12.0
func (r *KubernetesReporter) Dump(kubeCli *kubernetes.Clientset, cdiClient *cdiClientset.Clientset, since time.Duration)
Dump dumps the current state of the cluster. The relevant logs are collected starting from the since parameter.