mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Move xfs test skip logic from driver to testsuites
This commit is contained in:
parent
398bf3929f
commit
30ad1028eb
@ -259,9 +259,6 @@ func (g *glusterFSDriver) GetDriverInfo() *testsuites.DriverInfo {
|
|||||||
|
|
||||||
func (g *glusterFSDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
|
func (g *glusterFSDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
|
||||||
framework.SkipUnlessNodeOSDistroIs("gci", "ubuntu", "custom")
|
framework.SkipUnlessNodeOSDistroIs("gci", "ubuntu", "custom")
|
||||||
if pattern.FsType == "xfs" {
|
|
||||||
framework.SkipUnlessNodeOSDistroIs("ubuntu", "custom")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *glusterFSDriver) GetVolumeSource(readOnly bool, fsType string, testResource interface{}) *v1.VolumeSource {
|
func (g *glusterFSDriver) GetVolumeSource(readOnly bool, fsType string, testResource interface{}) *v1.VolumeSource {
|
||||||
@ -1178,9 +1175,6 @@ func (g *gcePdDriver) GetDriverInfo() *testsuites.DriverInfo {
|
|||||||
|
|
||||||
func (g *gcePdDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
|
func (g *gcePdDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
|
||||||
framework.SkipUnlessProviderIs("gce", "gke")
|
framework.SkipUnlessProviderIs("gce", "gke")
|
||||||
if pattern.FsType == "xfs" {
|
|
||||||
framework.SkipUnlessNodeOSDistroIs("ubuntu", "custom")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *gcePdDriver) GetVolumeSource(readOnly bool, fsType string, testResource interface{}) *v1.VolumeSource {
|
func (g *gcePdDriver) GetVolumeSource(readOnly bool, fsType string, testResource interface{}) *v1.VolumeSource {
|
||||||
|
@ -80,7 +80,7 @@ func RunTestSuite(f *framework.Framework, driver TestDriver, tsInits []func() Te
|
|||||||
// is not suitable to be tested.
|
// is not suitable to be tested.
|
||||||
// Whether it needs to be skipped is checked by following steps:
|
// Whether it needs to be skipped is checked by following steps:
|
||||||
// 1. Check if Whether volType is supported by driver from its interface
|
// 1. Check if Whether volType is supported by driver from its interface
|
||||||
// 2. Check if fsType is supported by driver
|
// 2. Check if fsType is supported
|
||||||
// 3. Check with driver specific logic
|
// 3. Check with driver specific logic
|
||||||
// 4. Check with testSuite specific logic
|
// 4. Check with testSuite specific logic
|
||||||
func skipUnsupportedTest(suite TestSuite, driver TestDriver, pattern testpatterns.TestPattern) {
|
func skipUnsupportedTest(suite TestSuite, driver TestDriver, pattern testpatterns.TestPattern) {
|
||||||
@ -103,10 +103,13 @@ func skipUnsupportedTest(suite TestSuite, driver TestDriver, pattern testpattern
|
|||||||
framework.Skipf("Driver %s doesn't support %v -- skipping", dInfo.Name, pattern.VolType)
|
framework.Skipf("Driver %s doesn't support %v -- skipping", dInfo.Name, pattern.VolType)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. Check if fsType is supported by driver
|
// 2. Check if fsType is supported
|
||||||
if !dInfo.SupportedFsType.Has(pattern.FsType) {
|
if !dInfo.SupportedFsType.Has(pattern.FsType) {
|
||||||
framework.Skipf("Driver %s doesn't support %v -- skipping", dInfo.Name, pattern.FsType)
|
framework.Skipf("Driver %s doesn't support %v -- skipping", dInfo.Name, pattern.FsType)
|
||||||
}
|
}
|
||||||
|
if pattern.FsType == "xfs" && framework.NodeOSDistroIs("gci") {
|
||||||
|
framework.Skipf("Distro doesn't support xfs -- skipping")
|
||||||
|
}
|
||||||
|
|
||||||
// 3. Check with driver specific logic
|
// 3. Check with driver specific logic
|
||||||
driver.SkipUnsupportedTest(pattern)
|
driver.SkipUnsupportedTest(pattern)
|
||||||
|
Loading…
Reference in New Issue
Block a user