[PATCH blktests v3 0/3] bcache: add initial test cases

Daniel Wagner <[email protected]> Thu, 22 Jan 2026 10:57:11 +0100
Newsgroups org.kernel.vger.linux-bcache,org.kernel.vger.linux-block
Message-ID <[email protected]>
I've added the test case from Stephen [1] which showed all the limitation in v2.
The cleanup code should be more robust now. The new test case reports

bcache/001 => nvme0n1 vdb vdc (test bcache setup and teardown) [passed]
    runtime  1.373s  ...  1.334s
bcache/002 => nvme0n1 vdb vdc (test bcache for bio leaks in clone) [failed]
    runtime  7.360s  ...  7.336s
    --- tests/bcache/002.out    2026-01-22 09:49:22.379130632 +0000
    +++ /tmp/blktests/nvme0n1_vdb_vdc/bcache/002.out.bad        2026-01-22 09:49:39.343331470 +0000
    @@ -1,2 +1,3 @@
     Running bcache/002
     Device state: no cache
    +ERROR: Accounting leak detected!

So it seems to do something. Though I think it could look at sysfs values
directly isntead using iostat. Though that's for another time.

I wont work on this in the next two weeks as I am on vacation. So no hurry to
review :)

Cheers,
Daniel

[1] https://lore.kernel.org/linux-bcache/CANubcdX7eNbH_bo4-f94DUbdiEbt04Vxy1MPyhm+CZyXB01FuQ@mail.gmail.com/
 

Signed-off-by: Daniel Wagner <[email protected]>
---
Changes in v3:
- add bcache/002
- return created bcache devices to tests case
- made cleanup more robust (handling detached cache)
- track all resources correctly
- operatoe only in final cleanup on known devices
- Link to v2: https://patch.msgid.link/[email protected]

Changes in v2:
- fixed whitespace damage
- added documentation on how to configure for bcache tests
- do registering explicitly
- made disk wiping more robust
- Link to v1: https://patch.msgid.link/[email protected]

---
Daniel Wagner (3):
      bcache: add bcache/001
      bcache: add bcache/002
      doc: document how to configure bcache tests

 Documentation/running-tests.md |  16 ++
 tests/bcache/001               |  48 ++++++
 tests/bcache/001.out           |   3 +
 tests/bcache/002               |  63 +++++++
 tests/bcache/002.out           |   2 +
 tests/bcache/rc                | 368 +++++++++++++++++++++++++++++++++++++++++
 6 files changed, 500 insertions(+)
---
base-commit: e387a7e0169cc012eb6a7140a0561d2901c92a76
change-id: 20260120-bcache-35ec7368c8f4

Best regards,
-- 
Daniel Wagner <[email protected]>