Skip to content

Commit

Permalink
e2e: restrict IO with lower version kernel at rbd-nbd tests
Browse files Browse the repository at this point in the history
Currently, at "perform IO on rbd-nbd volume after nodeplugin restart"
test we are performing write on the rbd-nbd based mount after nodeplugin
restart. But due to a bug in NBD driver the writes are failing, please
note NBD zero cmd timeout handling is fixed with kernel >= 5.4 and hence
we should defend on writes based on kernel version to avoid unnecessary
CI failures.

For more information see
#2204 (comment)

updates: #2204
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
  • Loading branch information
Prasanna Kumar Kalever authored and mergify[bot] committed Nov 10, 2021
1 parent 50e9dfa commit c97b643
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions e2e/rbd.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,6 @@ var _ = Describe("RBD", func() {
if err != nil {
e2elog.Failf("failed to get the kernel version with error %v", err)
}
// default io-timeout=0, needs kernel >= 5.4
if !util.CheckKernelSupport(kernelRelease, nbdZeroIOtimeoutSupport) {
nbdMapOptions = "debug-rbd=20,io-timeout=330"
}
})

AfterEach(func() {
Expand Down Expand Up @@ -674,14 +670,21 @@ var _ = Describe("RBD", func() {
e2elog.Failf("failed to poll: %v", err)
}

filePath := app.Spec.Containers[0].VolumeMounts[0].MountPath + "/test"
_, stdErr, err = execCommandInPod(
f,
fmt.Sprintf("echo 'Hello World' > %s", filePath),
app.Namespace,
&appOpt)
if err != nil || stdErr != "" {
e2elog.Failf("failed to write IO, err: %v, stdErr: %v ", err, stdErr)
// Writes on kernel < 5.4 are failing due to a bug in NBD driver,
// NBD zero cmd timeout handling is fixed with kernel >= 5.4
// see https://github.com/ceph/ceph-csi/issues/2204#issuecomment-930941047
if util.CheckKernelSupport(kernelRelease, nbdZeroIOtimeoutSupport) {
filePath := app.Spec.Containers[0].VolumeMounts[0].MountPath + "/test"
_, stdErr, err = execCommandInPod(
f,
fmt.Sprintf("echo 'Hello World' > %s", filePath),
app.Namespace,
&appOpt)
if err != nil || stdErr != "" {
e2elog.Failf("failed to write IO, err: %v, stdErr: %v ", err, stdErr)
}
} else {
e2elog.Logf("kernel %q does not meet recommendation, skipping IO test", kernelRelease)
}

err = deletePVCAndApp("", f, pvc, app)
Expand Down

0 comments on commit c97b643

Please sign in to comment.