mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
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:
parent
40a4c1f723
commit
f8536e8e42
@ -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,31 +102,30 @@ 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
|
||||||
|
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
|
if !isSupported {
|
||||||
switch pattern.VolType {
|
framework.Skipf("Driver %s doesn't support %v -- skipping", dInfo.Name, 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 {
|
// 3. Check if fsType is supported
|
||||||
framework.Skipf("Driver %s doesn't support %v -- skipping", dInfo.Name, pattern.VolType)
|
if !dInfo.SupportedFsType.Has(pattern.FsType) {
|
||||||
}
|
framework.Skipf("Driver %s doesn't support %v -- skipping", dInfo.Name, pattern.FsType)
|
||||||
|
}
|
||||||
// 3. Check if fsType is supported
|
if pattern.FsType == "xfs" && framework.NodeOSDistroIs("gci") {
|
||||||
if !dInfo.SupportedFsType.Has(pattern.FsType) {
|
framework.Skipf("Distro doesn't support xfs -- skipping")
|
||||||
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
|
// 4. Check with driver specific logic
|
||||||
|
Loading…
Reference in New Issue
Block a user