Change:
What happened: When we run csi hostpath driver e2e tests on a multi-node cluster some tests failed because they assume that volumes are node independent but this is not the case for some drivers like hostpath. Related PR; What you expected to happen: Skip the tests that assume volumes are node independent for the drivers that don't support node independent volumes. /sig storage /assign

Discussion:
testsuites.CapBlock:               true, testsuites.CapPVCDataSource:       true, testsuites.CapControllerExpansion: true, <ins> testsuites.CapSingleNodeVolume:    true, </ins> } return initHostPathCSIDriver("csi-hostpath", capabilities,

// InitHostPathV0CSIDriver returns a variant of hostpathCSIDriver with different manifests. func InitHostPathV0CSIDriver() testsuites.TestDriver { return initHostPathCSIDriver("csi-hostpath-v0", <del> map[testsuites.Capability]bool{testsuites.CapPersistence: true, testsuites.CapMultiPODs: true}, </del> <ins> map[testsuites.Capability]bool{testsuites.CapPersistence: true, testsuites.CapMultiPODs: true, testsuites.CapSingleNodeVolume: true}, </ins> nil, /* no volume attributes -> no ephemeral volume testing */ // 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

"", // Default fsType ), Capabilities: map[testsuites.Capability]bool{ <del> testsuites.CapPersistence: true, testsuites.CapMultiPODs:   true, </del> <ins> testsuites.CapPersistence:      true, testsuites.CapMultiPODs:        true, testsuites.CapSingleNodeVolume: true, </ins> }, }, }

"", // Default fsType ), Capabilities: map[testsuites.Capability]bool{ <del> testsuites.CapExec: true, </del> <ins> testsuites.CapExec:             true, testsuites.CapSingleNodeVolume: true, </ins> }, }, }

var ( // capabilities defaultLocalVolumeCapabilities = map[testsuites.Capability]bool{ <del> testsuites.CapPersistence: true, testsuites.CapFsGroup:     true, testsuites.CapBlock:       false, testsuites.CapExec:        true, testsuites.CapMultiPODs:   true, </del> <ins> testsuites.CapPersistence:      true, testsuites.CapFsGroup:          true, testsuites.CapBlock:            false, testsuites.CapExec:             true, testsuites.CapMultiPODs:        true, testsuites.CapSingleNodeVolume: true, </ins> } localVolumeCapabitilies = map[utils.LocalVolumeType]map[testsuites.Capability]bool{ utils.LocalVolumeBlock: { <del> testsuites.CapPersistence: true, testsuites.CapFsGroup:     true, testsuites.CapBlock:       true, testsuites.CapExec:        true, testsuites.CapMultiPODs:   true, </del> <ins> testsuites.CapPersistence:      true, testsuites.CapFsGroup:          true, testsuites.CapBlock:            true, testsuites.CapExec:             true, testsuites.CapMultiPODs:        true, testsuites.CapSingleNodeVolume: true, </ins> }, } // fstype

defer cleanup() // Check different-node test requirement <ins> if l.driver.GetDriverInfo().Capabilities[CapSingleNodeVolume] { framework.Skipf("Driver %s only supports %v -- skipping", l.driver.GetDriverInfo().Name, CapSingleNodeVolume) } </ins> nodes := framework.GetReadySchedulableNodesOrDie(l.cs) if len(nodes.Items) < 2 { framework.Skipf("Number of available nodes is less than 2 - skipping")

CapRWX                 Capability = "RWX"                 // support ReadWriteMany access modes CapControllerExpansion Capability = "controllerExpansion" // support volume expansion for controller CapNodeExpansion       Capability = "nodeExpansion"       // support volume expansion for node <del> CapVolumeLimits                   = "volumeLimits"        // support volume limits (can be *very* slow) </del> <ins> CapVolumeLimits        Capability = "volumeLimits"        // support volume limits (can be *very* slow) CapSingleNodeVolume    Capability = "singleNodeVolume"    // support volume that can run on single node (like hostpath) </ins> ) // DriverInfo represents static information about a TestDriver.