drivers

package
v1.13.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2018 License: Apache-2.0 Imports: 28 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{}

CreateVolume creates volume for test unless dynamicPV test

func DeleteVolume

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

DeleteVolume deletes volume for test unless dynamicPV test

func GetDriverNameWithFeatureTags

func GetDriverNameWithFeatureTags(driver TestDriver) string

GetDriverNameWithFeatureTags returns driver name with feature tags For example)

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

func GetUniqueDriverName added in v1.13.0

func GetUniqueDriverName(driver TestDriver) string

GetUniqueDriverName returns unique driver name that can be used parallelly in tests

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 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
	SupportedMountOption sets.String // Map of string for supported mount option
	RequiredMountOption  sets.String // Map of string for required mount option (Optional)
	IsPersistent         bool        // Flag to represent whether it provides persistency
	IsFsGroupSupported   bool        // Flag to represent whether it supports fsGroup
	IsBlockSupported     bool        // Flag to represent whether it supports Block Volume

	// 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 InitGcePDCSIDriver added in v1.13.0

func InitGcePDCSIDriver() TestDriver

InitGcePDCSIDriver returns gcePDCSIDriver that implements TestDriver interface

func InitGcePDExternalCSIDriver added in v1.13.0

func InitGcePDExternalCSIDriver() TestDriver

InitGcePDExternalCSIDriver returns gcePDExternalCSIDriver 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 InitHostPathCSIDriver added in v1.13.0

func InitHostPathCSIDriver() TestDriver

InitHostPathCSIDriver returns hostpathCSIDriver 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