drivers

package
v1.12.11-beta.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateVolume

func CreateVolume(driver TestDriver, volType testpatterns.TestVolType) interface{}

func DeleteVolume

func DeleteVolume(driver TestDriver, volType testpatterns.TestVolType, testResource interface{})

func GetDriverNameWithFeatureTags

func GetDriverNameWithFeatureTags(driver TestDriver) string

GetDriverNameWithFeatureTags returns driver name with feature tags For example)

  • [Driver: nfs]
  • [Driver: rbd][Feature:Volumes]

func SetCommonDriverParameters

func SetCommonDriverParameters(
	driver TestDriver,
	f *framework.Framework,
	config framework.VolumeTestConfig,
)

SetCommonDriverParameters sets a common driver parameters to TestDriver This function is intended to be called in BeforeEach() inside test loop.

Types

type Capability added in v1.12.5

type Capability string

Capability represents a feature that a volume plugin supports

const (
	CapPersistence Capability = "persistence" // data is persisted across pod restarts
	CapBlock       Capability = "block"       // raw block mode
	CapFsGroup     Capability = "fsGroup"     // volume ownership via fsGroup
	CapExec        Capability = "exec"        // exec a file in the volume
)

type DriverInfo

type DriverInfo struct {
	Name       string // Name of the driver
	FeatureTag string // FeatureTag for the driver

	MaxFileSize     int64               // Max file size to be tested for this driver
	SupportedFsType sets.String         // Map of string for supported fs type
	Capabilities    map[Capability]bool // Map that represents plugin capabilities

	// Parameters below will be set inside test loop by using SetCommonDriverParameters.
	// Drivers that implement TestDriver is required to set all the above parameters
	// and return DriverInfo on GetDriverInfo() call.
	Framework *framework.Framework       // Framework for the test
	Config    framework.VolumeTestConfig // VolumeTestConfig for thet test
}

DriverInfo represents a combination of parameters to be used in implementation of TestDriver

type DynamicPVTestDriver

type DynamicPVTestDriver interface {
	TestDriver
	// GetDynamicProvisionStorageClass returns a StorageClass dynamic provision Persistent Volume.
	// It will set fsType to the StorageClass, if TestDriver supports it.
	// It will return nil, if the TestDriver doesn't support it.
	GetDynamicProvisionStorageClass(fsType string) *storagev1.StorageClass
}

DynamicPVTestDriver represents an interface for a TestDriver that supports DynamicPV

type InlineVolumeTestDriver

type InlineVolumeTestDriver interface {
	PreprovisionedVolumeTestDriver
	// GetVolumeSource returns a volumeSource for inline volume.
	// It will set readOnly and fsType to the volumeSource, if TestDriver supports both of them.
	// It will return nil, if the TestDriver doesn't support either of the parameters.
	GetVolumeSource(readOnly bool, fsType string, testResource interface{}) *v1.VolumeSource
}

InlineVolumeTestDriver represents an interface for a TestDriver that supports InlineVolume

type PreprovisionedPVTestDriver

type PreprovisionedPVTestDriver interface {
	PreprovisionedVolumeTestDriver
	// GetPersistentVolumeSource returns a PersistentVolumeSource for pre-provisioned Persistent Volume.
	// It will set readOnly and fsType to the PersistentVolumeSource, if TestDriver supports both of them.
	// It will return nil, if the TestDriver doesn't support either of the parameters.
	GetPersistentVolumeSource(readOnly bool, fsType string, testResource interface{}) *v1.PersistentVolumeSource
}

PreprovisionedPVTestDriver represents an interface for a TestDriver that supports PreprovisionedPV

type PreprovisionedVolumeTestDriver

type PreprovisionedVolumeTestDriver interface {
	TestDriver
	// CreateVolume creates a pre-provisioned volume.
	CreateVolume(testpatterns.TestVolType) interface{}
	// DeleteVolume deletes a volume that is created in CreateVolume
	DeleteVolume(testpatterns.TestVolType, interface{})
}

PreprovisionedVolumeTestDriver represents an interface for a TestDriver that has pre-provisioned volume

type TestDriver

type TestDriver interface {
	// GetDriverInfo returns DriverInfo for the TestDriver
	GetDriverInfo() *DriverInfo
	// CreateDriver creates all driver resources that is required for TestDriver method
	// except CreateVolume
	CreateDriver()
	// CreateDriver cleanup all the resources that is created in CreateDriver
	CleanupDriver()
	// SkipUnsupportedTest skips test in Testpattern is not suitable to test with the TestDriver
	SkipUnsupportedTest(testpatterns.TestPattern)
}

TestDriver represents an interface for a driver to be tested in TestSuite

func InitAwsDriver

func InitAwsDriver() TestDriver

InitAwsDriver returns awsDriver that implements TestDriver interface

func InitAzureDriver

func InitAzureDriver() TestDriver

InitAzureDriver returns azureDriver that implements TestDriver interface

func InitCephFSDriver

func InitCephFSDriver() TestDriver

InitCephFSDriver returns cephFSDriver that implements TestDriver interface

func InitCinderDriver

func InitCinderDriver() TestDriver

InitCinderDriver returns cinderDriver that implements TestDriver interface

func InitEmptydirDriver

func InitEmptydirDriver() TestDriver

InitEmptydirDriver returns emptydirDriver that implements TestDriver interface

func InitGcePdDriver

func InitGcePdDriver() TestDriver

InitGceDriver returns gcePdDriver that implements TestDriver interface

func InitGlusterFSDriver

func InitGlusterFSDriver() TestDriver

InitGlusterFSDriver returns glusterFSDriver that implements TestDriver interface

func InitHostPathDriver

func InitHostPathDriver() TestDriver

InitHostpathDriver returns hostPathDriver that implements TestDriver interface

func InitHostPathSymlinkDriver

func InitHostPathSymlinkDriver() TestDriver

InitHostPathSymlinkDriver returns hostPathSymlinkDriver that implements TestDriver interface

func InitISCSIDriver

func InitISCSIDriver() TestDriver

InitISCSIDriver returns iSCSIDriver that implements TestDriver interface

func InitNFSDriver

func InitNFSDriver() TestDriver

InitNFSDriver returns nfsDriver that implements TestDriver interface

func InitRbdDriver

func InitRbdDriver() TestDriver

InitRbdDriver returns rbdDriver that implements TestDriver interface

func InitVSphereDriver

func InitVSphereDriver() TestDriver

InitVSphereDriver returns vSphereDriver that implements TestDriver interface

Jump to

Keyboard shortcuts

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