e2e: fix snapshot skip test

Even if snapshots are supported by the driver interface, the driver or
suite might still want to skip a particular test, so those checks
still need to be executed.
This commit is contained in:
Patrick Ohly 2019-02-09 14:07:01 +01:00
parent 40a4c1f723
commit f8536e8e42

View File

@ -91,7 +91,7 @@ func skipUnsupportedTest(suite TestSuite, driver TestDriver, pattern testpattern
var isSupported bool var isSupported bool
// 1. Check if Whether SnapshotType is supported by driver from its interface // 1. Check if Whether SnapshotType is supported by driver from its interface
// if isSupported, so it must be a snapshot test case, we just return. // if isSupported, we still execute the driver and suite tests
if len(pattern.SnapshotType) > 0 { if len(pattern.SnapshotType) > 0 {
switch pattern.SnapshotType { switch pattern.SnapshotType {
case testpatterns.DynamicCreatedSnapshot: case testpatterns.DynamicCreatedSnapshot:
@ -102,9 +102,7 @@ func skipUnsupportedTest(suite TestSuite, driver TestDriver, pattern testpattern
if !isSupported { if !isSupported {
framework.Skipf("Driver %s doesn't support snapshot type %v -- skipping", dInfo.Name, pattern.SnapshotType) framework.Skipf("Driver %s doesn't support snapshot type %v -- skipping", dInfo.Name, pattern.SnapshotType)
} }
return } else {
}
// 2. Check if Whether volType is supported by driver from its interface // 2. Check if Whether volType is supported by driver from its interface
switch pattern.VolType { switch pattern.VolType {
case testpatterns.InlineVolume: case testpatterns.InlineVolume:
@ -128,6 +126,7 @@ func skipUnsupportedTest(suite TestSuite, driver TestDriver, pattern testpattern
if pattern.FsType == "xfs" && framework.NodeOSDistroIs("gci") { if pattern.FsType == "xfs" && framework.NodeOSDistroIs("gci") {
framework.Skipf("Distro doesn't support xfs -- skipping") framework.Skipf("Distro doesn't support xfs -- skipping")
} }
}
// 4. Check with driver specific logic // 4. Check with driver specific logic
driver.SkipUnsupportedTest(pattern) driver.SkipUnsupportedTest(pattern)