From 30ad1028ebf6beb0c6c0957222d87e228171f94b Mon Sep 17 00:00:00 2001 From: Masaki Kimura Date: Thu, 29 Nov 2018 23:11:31 +0000 Subject: [PATCH] Move xfs test skip logic from driver to testsuites --- test/e2e/storage/drivers/in_tree.go | 6 ------ test/e2e/storage/testsuites/base.go | 7 +++++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/test/e2e/storage/drivers/in_tree.go b/test/e2e/storage/drivers/in_tree.go index 728ab69794f..908516da6e5 100644 --- a/test/e2e/storage/drivers/in_tree.go +++ b/test/e2e/storage/drivers/in_tree.go @@ -259,9 +259,6 @@ func (g *glusterFSDriver) GetDriverInfo() *testsuites.DriverInfo { func (g *glusterFSDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) { 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 { @@ -1178,9 +1175,6 @@ func (g *gcePdDriver) GetDriverInfo() *testsuites.DriverInfo { func (g *gcePdDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) { framework.SkipUnlessProviderIs("gce", "gke") - if pattern.FsType == "xfs" { - framework.SkipUnlessNodeOSDistroIs("ubuntu", "custom") - } } func (g *gcePdDriver) GetVolumeSource(readOnly bool, fsType string, testResource interface{}) *v1.VolumeSource { diff --git a/test/e2e/storage/testsuites/base.go b/test/e2e/storage/testsuites/base.go index 8638a90cfe1..c1fba8a2453 100644 --- a/test/e2e/storage/testsuites/base.go +++ b/test/e2e/storage/testsuites/base.go @@ -80,7 +80,7 @@ func RunTestSuite(f *framework.Framework, driver TestDriver, tsInits []func() Te // is not suitable to be tested. // Whether it needs to be skipped is checked by following steps: // 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 // 4. Check with testSuite specific logic 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) } - // 2. Check if fsType is supported by driver + // 2. Check if fsType is supported if !dInfo.SupportedFsType.Has(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 driver.SkipUnsupportedTest(pattern)