mirror of https://github.com/k3s-io/k3s
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.pull/564/head
parent
40a4c1f723
commit
f8536e8e42
|
@ -91,7 +91,7 @@ func skipUnsupportedTest(suite TestSuite, driver TestDriver, pattern testpattern
|
|||
var isSupported bool
|
||||
|
||||
// 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 {
|
||||
switch pattern.SnapshotType {
|
||||
case testpatterns.DynamicCreatedSnapshot:
|
||||
|
@ -102,31 +102,30 @@ func skipUnsupportedTest(suite TestSuite, driver TestDriver, pattern testpattern
|
|||
if !isSupported {
|
||||
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
|
||||
switch pattern.VolType {
|
||||
case testpatterns.InlineVolume:
|
||||
_, isSupported = driver.(InlineVolumeTestDriver)
|
||||
case testpatterns.PreprovisionedPV:
|
||||
_, isSupported = driver.(PreprovisionedPVTestDriver)
|
||||
case testpatterns.DynamicPV:
|
||||
_, isSupported = driver.(DynamicPVTestDriver)
|
||||
default:
|
||||
isSupported = false
|
||||
}
|
||||
|
||||
// 2. Check if Whether volType is supported by driver from its interface
|
||||
switch pattern.VolType {
|
||||
case testpatterns.InlineVolume:
|
||||
_, isSupported = driver.(InlineVolumeTestDriver)
|
||||
case testpatterns.PreprovisionedPV:
|
||||
_, isSupported = driver.(PreprovisionedPVTestDriver)
|
||||
case testpatterns.DynamicPV:
|
||||
_, isSupported = driver.(DynamicPVTestDriver)
|
||||
default:
|
||||
isSupported = false
|
||||
}
|
||||
if !isSupported {
|
||||
framework.Skipf("Driver %s doesn't support %v -- skipping", dInfo.Name, pattern.VolType)
|
||||
}
|
||||
|
||||
if !isSupported {
|
||||
framework.Skipf("Driver %s doesn't support %v -- skipping", dInfo.Name, pattern.VolType)
|
||||
}
|
||||
|
||||
// 3. 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 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")
|
||||
}
|
||||
}
|
||||
|
||||
// 4. Check with driver specific logic
|
||||
|
|
Loading…
Reference in New Issue