mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 11:00:25 +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)
|
err = createPVCAndvalidatePV(f.ClientSet, pvc, deployTimeout)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if rwopMayFail(err) {
|
||||||
|
e2elog.Logf("RWOP is not supported: %v", err)
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
e2elog.Failf("failed to create PVC: %v", err)
|
e2elog.Failf("failed to create PVC: %v", err)
|
||||||
}
|
}
|
||||||
err = createApp(f.ClientSet, app, deployTimeout)
|
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
|
baseAppName := app.Name
|
||||||
err = createPVCAndvalidatePV(f.ClientSet, pvc, deployTimeout)
|
err = createPVCAndvalidatePV(f.ClientSet, pvc, deployTimeout)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if rwopMayFail(err) {
|
||||||
|
e2elog.Logf("RWOP is not supported: %v", err)
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
e2elog.Failf("failed to create PVC: %v", err)
|
e2elog.Failf("failed to create PVC: %v", err)
|
||||||
}
|
}
|
||||||
// validate created backend rbd images
|
// validate created backend rbd images
|
||||||
@ -828,6 +833,11 @@ var _ = Describe("RBD", func() {
|
|||||||
baseAppName := app.Name
|
baseAppName := app.Name
|
||||||
err = createPVCAndvalidatePV(f.ClientSet, pvc, deployTimeout)
|
err = createPVCAndvalidatePV(f.ClientSet, pvc, deployTimeout)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if rwopMayFail(err) {
|
||||||
|
e2elog.Logf("RWOP is not supported: %v", err)
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
e2elog.Failf("failed to create PVC: %v", err)
|
e2elog.Failf("failed to create PVC: %v", err)
|
||||||
}
|
}
|
||||||
// validate created backend rbd images
|
// 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
|
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