Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated cherry pick of #82678: skip e2e tests that run on multi node cluster and require #85833

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/e2e/storage/drivers/csi.go
Expand Up @@ -86,7 +86,7 @@ var _ testsuites.SnapshottableTestDriver = &hostpathCSIDriver{}
func InitHostPathCSIDriver() testsuites.TestDriver {
return initHostPathCSIDriver("csi-hostpath",
map[testsuites.Capability]bool{testsuites.CapPersistence: true, testsuites.CapDataSource: true,
testsuites.CapMultiPODs: true, testsuites.CapBlock: true},
testsuites.CapMultiPODs: true, testsuites.CapBlock: true, testsuites.CapSingleNodeVolume: true},
"test/e2e/testing-manifests/storage-csi/driver-registrar/rbac.yaml",
"test/e2e/testing-manifests/storage-csi/external-attacher/rbac.yaml",
"test/e2e/testing-manifests/storage-csi/external-provisioner/rbac.yaml",
Expand Down
27 changes: 16 additions & 11 deletions test/e2e/storage/drivers/in_tree.go
Expand Up @@ -696,7 +696,8 @@ func InitHostPathDriver() testsuites.TestDriver {
"", // Default fsType
),
Capabilities: map[testsuites.Capability]bool{
testsuites.CapPersistence: true,
testsuites.CapPersistence: true,
testsuites.CapSingleNodeVolume: true,
},
},
}
Expand Down Expand Up @@ -769,7 +770,8 @@ func InitHostPathSymlinkDriver() testsuites.TestDriver {
"", // Default fsType
),
Capabilities: map[testsuites.Capability]bool{
testsuites.CapPersistence: true,
testsuites.CapPersistence: true,
testsuites.CapSingleNodeVolume: true,
},
},
}
Expand Down Expand Up @@ -910,7 +912,8 @@ func InitEmptydirDriver() testsuites.TestDriver {
"", // Default fsType
),
Capabilities: map[testsuites.Capability]bool{
testsuites.CapExec: true,
testsuites.CapExec: true,
testsuites.CapSingleNodeVolume: true,
},
},
}
Expand Down Expand Up @@ -1619,17 +1622,19 @@ type localVolume struct {
var (
// capabilities
defaultLocalVolumeCapabilities = map[testsuites.Capability]bool{
testsuites.CapPersistence: true,
testsuites.CapFsGroup: true,
testsuites.CapBlock: false,
testsuites.CapExec: true,
testsuites.CapPersistence: true,
testsuites.CapFsGroup: true,
testsuites.CapBlock: false,
testsuites.CapExec: true,
testsuites.CapSingleNodeVolume: true,
}
localVolumeCapabitilies = map[utils.LocalVolumeType]map[testsuites.Capability]bool{
utils.LocalVolumeBlock: {
testsuites.CapPersistence: true,
testsuites.CapFsGroup: true,
testsuites.CapBlock: true,
testsuites.CapExec: true,
testsuites.CapPersistence: true,
testsuites.CapFsGroup: true,
testsuites.CapBlock: true,
testsuites.CapExec: true,
testsuites.CapSingleNodeVolume: true,
},
}
// fstype
Expand Down
6 changes: 6 additions & 0 deletions test/e2e/storage/testsuites/multivolume.go
Expand Up @@ -156,6 +156,9 @@ func (t *multiVolumeTestSuite) defineTests(driver TestDriver, pattern testpatter
defer cleanup()

// 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)
if len(nodes.Items) < 2 {
framework.Skipf("Number of available nodes is less than 2 - skipping")
Expand Down Expand Up @@ -236,6 +239,9 @@ func (t *multiVolumeTestSuite) defineTests(driver TestDriver, pattern testpatter
defer cleanup()

// 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)
if len(nodes.Items) < 2 {
framework.Skipf("Number of available nodes is less than 2 - skipping")
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/storage/testsuites/provisioning.go
Expand Up @@ -187,6 +187,10 @@ func (p *provisioningTestSuite) defineTests(driver TestDriver, pattern testpatte
framework.Skipf("Driver %q only supports testing on one node - skipping", dInfo.Name)
}

if dInfo.Capabilities[CapSingleNodeVolume] {
framework.Skipf("Driver %q only supports testing on one node - skipping", dInfo.Name)
}

// Ensure that we actually have more than one node.
nodes := framework.GetReadySchedulableNodesOrDie(l.cs)
if len(nodes.Items) <= 1 {
Expand Down
5 changes: 3 additions & 2 deletions test/e2e/storage/testsuites/testdriver.go
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package testsuites

import (
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
storagev1 "k8s.io/api/storage/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/util/sets"
Expand Down Expand Up @@ -126,7 +126,8 @@ const (
// - NodeStageVolume in the spec
CapMultiPODs Capability = "multipods"

CapRWX Capability = "RWX" // support ReadWriteMany access modes
CapRWX Capability = "RWX" // support ReadWriteMany access modes
CapSingleNodeVolume Capability = "singleNodeVolume" // support volume that can run on single node (like hostpath)
)

// DriverInfo represents static information about a TestDriver.
Expand Down