skip e2e tests that run on multi node cluster and require node independent volume for the drivers that does not support node independent volumes, like hostpath

Signed-off-by: Mucahit Kurt <mucahitkurt@gmail.com>
This commit is contained in:
Mucahit Kurt 2019-09-13 01:10:49 +03:00
parent 85827dc224
commit f0aa13cd46
4 changed files with 30 additions and 17 deletions

View File

@ -96,6 +96,7 @@ func InitHostPathCSIDriver() testsuites.TestDriver {
testsuites.CapBlock: true, testsuites.CapBlock: true,
testsuites.CapPVCDataSource: true, testsuites.CapPVCDataSource: true,
testsuites.CapControllerExpansion: true, testsuites.CapControllerExpansion: true,
testsuites.CapSingleNodeVolume: true,
} }
return initHostPathCSIDriver("csi-hostpath", return initHostPathCSIDriver("csi-hostpath",
capabilities, capabilities,
@ -345,7 +346,7 @@ func (m *mockCSIDriver) PrepareTest(f *framework.Framework) (*testsuites.PerTest
// InitHostPathV0CSIDriver returns a variant of hostpathCSIDriver with different manifests. // InitHostPathV0CSIDriver returns a variant of hostpathCSIDriver with different manifests.
func InitHostPathV0CSIDriver() testsuites.TestDriver { func InitHostPathV0CSIDriver() testsuites.TestDriver {
return initHostPathCSIDriver("csi-hostpath-v0", return initHostPathCSIDriver("csi-hostpath-v0",
map[testsuites.Capability]bool{testsuites.CapPersistence: true, testsuites.CapMultiPODs: true}, map[testsuites.Capability]bool{testsuites.CapPersistence: true, testsuites.CapMultiPODs: true, testsuites.CapSingleNodeVolume: true},
nil, /* no volume attributes -> no ephemeral volume testing */ nil, /* no volume attributes -> no ephemeral volume testing */
// Using the current set of rbac.yaml files is problematic here because they don't // Using the current set of rbac.yaml files is problematic here because they don't
// match the version of the rules that were written for the releases of external-attacher // match the version of the rules that were written for the releases of external-attacher

View File

@ -701,8 +701,9 @@ func InitHostPathDriver() testsuites.TestDriver {
"", // Default fsType "", // Default fsType
), ),
Capabilities: map[testsuites.Capability]bool{ Capabilities: map[testsuites.Capability]bool{
testsuites.CapPersistence: true, testsuites.CapPersistence: true,
testsuites.CapMultiPODs: true, testsuites.CapMultiPODs: true,
testsuites.CapSingleNodeVolume: true,
}, },
}, },
} }
@ -775,8 +776,9 @@ func InitHostPathSymlinkDriver() testsuites.TestDriver {
"", // Default fsType "", // Default fsType
), ),
Capabilities: map[testsuites.Capability]bool{ Capabilities: map[testsuites.Capability]bool{
testsuites.CapPersistence: true, testsuites.CapPersistence: true,
testsuites.CapMultiPODs: true, testsuites.CapMultiPODs: true,
testsuites.CapSingleNodeVolume: true,
}, },
}, },
} }
@ -917,7 +919,8 @@ func InitEmptydirDriver() testsuites.TestDriver {
"", // Default fsType "", // Default fsType
), ),
Capabilities: map[testsuites.Capability]bool{ Capabilities: map[testsuites.Capability]bool{
testsuites.CapExec: true, testsuites.CapExec: true,
testsuites.CapSingleNodeVolume: true,
}, },
}, },
} }
@ -1677,19 +1680,21 @@ type localVolume struct {
var ( var (
// capabilities // capabilities
defaultLocalVolumeCapabilities = map[testsuites.Capability]bool{ defaultLocalVolumeCapabilities = map[testsuites.Capability]bool{
testsuites.CapPersistence: true, testsuites.CapPersistence: true,
testsuites.CapFsGroup: true, testsuites.CapFsGroup: true,
testsuites.CapBlock: false, testsuites.CapBlock: false,
testsuites.CapExec: true, testsuites.CapExec: true,
testsuites.CapMultiPODs: true, testsuites.CapMultiPODs: true,
testsuites.CapSingleNodeVolume: true,
} }
localVolumeCapabitilies = map[utils.LocalVolumeType]map[testsuites.Capability]bool{ localVolumeCapabitilies = map[utils.LocalVolumeType]map[testsuites.Capability]bool{
utils.LocalVolumeBlock: { utils.LocalVolumeBlock: {
testsuites.CapPersistence: true, testsuites.CapPersistence: true,
testsuites.CapFsGroup: true, testsuites.CapFsGroup: true,
testsuites.CapBlock: true, testsuites.CapBlock: true,
testsuites.CapExec: true, testsuites.CapExec: true,
testsuites.CapMultiPODs: true, testsuites.CapMultiPODs: true,
testsuites.CapSingleNodeVolume: true,
}, },
} }
// fstype // fstype

View File

@ -161,6 +161,9 @@ func (t *multiVolumeTestSuite) defineTests(driver TestDriver, pattern testpatter
defer cleanup() defer cleanup()
// Check different-node test requirement // Check different-node test requirement
if l.driver.GetDriverInfo().Capabilities[CapSingleNodeVolume] {
framework.Skipf("Driver %s only supports %v -- skipping", l.driver.GetDriverInfo().Name, CapSingleNodeVolume)
}
nodes := framework.GetReadySchedulableNodesOrDie(l.cs) nodes := framework.GetReadySchedulableNodesOrDie(l.cs)
if len(nodes.Items) < 2 { if len(nodes.Items) < 2 {
framework.Skipf("Number of available nodes is less than 2 - skipping") framework.Skipf("Number of available nodes is less than 2 - skipping")
@ -241,6 +244,9 @@ func (t *multiVolumeTestSuite) defineTests(driver TestDriver, pattern testpatter
defer cleanup() defer cleanup()
// Check different-node test requirement // Check different-node test requirement
if l.driver.GetDriverInfo().Capabilities[CapSingleNodeVolume] {
framework.Skipf("Driver %s only supports %v -- skipping", l.driver.GetDriverInfo().Name, CapSingleNodeVolume)
}
nodes := framework.GetReadySchedulableNodesOrDie(l.cs) nodes := framework.GetReadySchedulableNodesOrDie(l.cs)
if len(nodes.Items) < 2 { if len(nodes.Items) < 2 {
framework.Skipf("Number of available nodes is less than 2 - skipping") framework.Skipf("Number of available nodes is less than 2 - skipping")

View File

@ -155,7 +155,8 @@ const (
CapRWX Capability = "RWX" // support ReadWriteMany access modes CapRWX Capability = "RWX" // support ReadWriteMany access modes
CapControllerExpansion Capability = "controllerExpansion" // support volume expansion for controller CapControllerExpansion Capability = "controllerExpansion" // support volume expansion for controller
CapNodeExpansion Capability = "nodeExpansion" // support volume expansion for node CapNodeExpansion Capability = "nodeExpansion" // support volume expansion for node
CapVolumeLimits = "volumeLimits" // support volume limits (can be *very* slow) CapVolumeLimits Capability = "volumeLimits" // support volume limits (can be *very* slow)
CapSingleNodeVolume Capability = "singleNodeVolume" // support volume that can run on single node (like hostpath)
) )
// DriverInfo represents static information about a TestDriver. // DriverInfo represents static information about a TestDriver.