mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-17 20:00:23 +00:00
e2e: allow RWOP tests to fail
Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
parent
b82af7559b
commit
5e66372e31
@ -339,6 +339,11 @@ var _ = Describe("cephfs", func() {
|
||||
|
||||
err = createPVCAndvalidatePV(f.ClientSet, pvc, deployTimeout)
|
||||
if err != nil {
|
||||
if rwopMayFail(err) {
|
||||
e2elog.Logf("RWOP is not supported: %v", err)
|
||||
|
||||
return
|
||||
}
|
||||
e2elog.Failf("failed to create PVC: %v", err)
|
||||
}
|
||||
err = createApp(f.ClientSet, app, deployTimeout)
|
||||
|
10
e2e/rbd.go
10
e2e/rbd.go
@ -794,6 +794,11 @@ var _ = Describe("RBD", func() {
|
||||
baseAppName := app.Name
|
||||
err = createPVCAndvalidatePV(f.ClientSet, pvc, deployTimeout)
|
||||
if err != nil {
|
||||
if rwopMayFail(err) {
|
||||
e2elog.Logf("RWOP is not supported: %v", err)
|
||||
|
||||
return
|
||||
}
|
||||
e2elog.Failf("failed to create PVC: %v", err)
|
||||
}
|
||||
// validate created backend rbd images
|
||||
@ -828,6 +833,11 @@ var _ = Describe("RBD", func() {
|
||||
baseAppName := app.Name
|
||||
err = createPVCAndvalidatePV(f.ClientSet, pvc, deployTimeout)
|
||||
if err != nil {
|
||||
if rwopMayFail(err) {
|
||||
e2elog.Logf("RWOP is not supported: %v", err)
|
||||
|
||||
return
|
||||
}
|
||||
e2elog.Failf("failed to create PVC: %v", err)
|
||||
}
|
||||
// validate created backend rbd images
|
||||
|
19
e2e/utils.go
19
e2e/utils.go
@ -1492,3 +1492,22 @@ func retryKubectlArgs(namespace string, action kubectlAction, t int, args ...str
|
||||
return true, nil
|
||||
})
|
||||
}
|
||||
|
||||
// rwopSupported indicates that a test using RWOP is expected to succeed. If
|
||||
// the accessMode is reported as invalid, rwopSupported will be set to false.
|
||||
var rwopSupported = true
|
||||
|
||||
// rwopMayFail returns true if the accessMode is not valid. k8s v1.22 requires
|
||||
// a feature gate, which might not be set. In case the accessMode is invalid,
|
||||
// the featuregate is not set, and testing RWOP is not possible.
|
||||
func rwopMayFail(err error) bool {
|
||||
if !rwopSupported {
|
||||
return true
|
||||
}
|
||||
|
||||
if strings.Contains(err.Error(), `invalid: spec.accessModes: Unsupported value: "ReadWriteOncePod"`) {
|
||||
rwopSupported = false
|
||||
}
|
||||
|
||||
return !rwopSupported
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user