Skip to content

Commit c2a3f0b

Browse files
authored
Merge pull request kubernetes#82678 from mucahitkurt/skip-multi-node-vol-availability-tests-for-hostpath
Skip e2e tests that require node independent volume for the drivers that don't support node independent volumes
2 parents 7f084f0 + f0aa13c commit c2a3f0b

File tree

4 files changed

+30
-17
lines changed

4 files changed

+30
-17
lines changed

test/e2e/storage/drivers/csi.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ func InitHostPathCSIDriver() testsuites.TestDriver {
9696
testsuites.CapBlock: true,
9797
testsuites.CapPVCDataSource: true,
9898
testsuites.CapControllerExpansion: true,
99+
testsuites.CapSingleNodeVolume: true,
99100
}
100101
return initHostPathCSIDriver("csi-hostpath",
101102
capabilities,
@@ -345,7 +346,7 @@ func (m *mockCSIDriver) PrepareTest(f *framework.Framework) (*testsuites.PerTest
345346
// InitHostPathV0CSIDriver returns a variant of hostpathCSIDriver with different manifests.
346347
func InitHostPathV0CSIDriver() testsuites.TestDriver {
347348
return initHostPathCSIDriver("csi-hostpath-v0",
348-
map[testsuites.Capability]bool{testsuites.CapPersistence: true, testsuites.CapMultiPODs: true},
349+
map[testsuites.Capability]bool{testsuites.CapPersistence: true, testsuites.CapMultiPODs: true, testsuites.CapSingleNodeVolume: true},
349350
nil, /* no volume attributes -> no ephemeral volume testing */
350351
// Using the current set of rbac.yaml files is problematic here because they don't
351352
// match the version of the rules that were written for the releases of external-attacher

test/e2e/storage/drivers/in_tree.go

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -701,8 +701,9 @@ func InitHostPathDriver() testsuites.TestDriver {
701701
"", // Default fsType
702702
),
703703
Capabilities: map[testsuites.Capability]bool{
704-
testsuites.CapPersistence: true,
705-
testsuites.CapMultiPODs: true,
704+
testsuites.CapPersistence: true,
705+
testsuites.CapMultiPODs: true,
706+
testsuites.CapSingleNodeVolume: true,
706707
},
707708
},
708709
}
@@ -775,8 +776,9 @@ func InitHostPathSymlinkDriver() testsuites.TestDriver {
775776
"", // Default fsType
776777
),
777778
Capabilities: map[testsuites.Capability]bool{
778-
testsuites.CapPersistence: true,
779-
testsuites.CapMultiPODs: true,
779+
testsuites.CapPersistence: true,
780+
testsuites.CapMultiPODs: true,
781+
testsuites.CapSingleNodeVolume: true,
780782
},
781783
},
782784
}
@@ -917,7 +919,8 @@ func InitEmptydirDriver() testsuites.TestDriver {
917919
"", // Default fsType
918920
),
919921
Capabilities: map[testsuites.Capability]bool{
920-
testsuites.CapExec: true,
922+
testsuites.CapExec: true,
923+
testsuites.CapSingleNodeVolume: true,
921924
},
922925
},
923926
}
@@ -1677,19 +1680,21 @@ type localVolume struct {
16771680
var (
16781681
// capabilities
16791682
defaultLocalVolumeCapabilities = map[testsuites.Capability]bool{
1680-
testsuites.CapPersistence: true,
1681-
testsuites.CapFsGroup: true,
1682-
testsuites.CapBlock: false,
1683-
testsuites.CapExec: true,
1684-
testsuites.CapMultiPODs: true,
1683+
testsuites.CapPersistence: true,
1684+
testsuites.CapFsGroup: true,
1685+
testsuites.CapBlock: false,
1686+
testsuites.CapExec: true,
1687+
testsuites.CapMultiPODs: true,
1688+
testsuites.CapSingleNodeVolume: true,
16851689
}
16861690
localVolumeCapabitilies = map[utils.LocalVolumeType]map[testsuites.Capability]bool{
16871691
utils.LocalVolumeBlock: {
1688-
testsuites.CapPersistence: true,
1689-
testsuites.CapFsGroup: true,
1690-
testsuites.CapBlock: true,
1691-
testsuites.CapExec: true,
1692-
testsuites.CapMultiPODs: true,
1692+
testsuites.CapPersistence: true,
1693+
testsuites.CapFsGroup: true,
1694+
testsuites.CapBlock: true,
1695+
testsuites.CapExec: true,
1696+
testsuites.CapMultiPODs: true,
1697+
testsuites.CapSingleNodeVolume: true,
16931698
},
16941699
}
16951700
// fstype

test/e2e/storage/testsuites/multivolume.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ func (t *multiVolumeTestSuite) defineTests(driver TestDriver, pattern testpatter
161161
defer cleanup()
162162

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

243246
// Check different-node test requirement
247+
if l.driver.GetDriverInfo().Capabilities[CapSingleNodeVolume] {
248+
framework.Skipf("Driver %s only supports %v -- skipping", l.driver.GetDriverInfo().Name, CapSingleNodeVolume)
249+
}
244250
nodes := framework.GetReadySchedulableNodesOrDie(l.cs)
245251
if len(nodes.Items) < 2 {
246252
framework.Skipf("Number of available nodes is less than 2 - skipping")

test/e2e/storage/testsuites/testdriver.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ const (
155155
CapRWX Capability = "RWX" // support ReadWriteMany access modes
156156
CapControllerExpansion Capability = "controllerExpansion" // support volume expansion for controller
157157
CapNodeExpansion Capability = "nodeExpansion" // support volume expansion for node
158-
CapVolumeLimits = "volumeLimits" // support volume limits (can be *very* slow)
158+
CapVolumeLimits Capability = "volumeLimits" // support volume limits (can be *very* slow)
159+
CapSingleNodeVolume Capability = "singleNodeVolume" // support volume that can run on single node (like hostpath)
159160
)
160161

161162
// DriverInfo represents static information about a TestDriver.

0 commit comments

Comments
 (0)