]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
test/osd: Add extensive new PGBackend test harness.
authorAlex Ainscow <aainscow@uk.ibm.com>
Sun, 1 Mar 2026 22:33:52 +0000 (22:33 +0000)
committerAlex Ainscow <aainscow@uk.ibm.com>
Tue, 24 Mar 2026 17:33:55 +0000 (17:33 +0000)
commitd09c115a31ba0ad6744a8c31adcd0c1e59da64cf
treef5d861a8183c91a1942bb95a342c751e915a2476
parente4a46ae2019976e22d1f20305987cd0cb9801c97
test/osd: Add extensive new PGBackend test harness.

The exists unittest harness for EC were limited to the functionality
that did not require bluestore, messaging or other infrastructure.
This significantly limited the testing possible in this framework.

This test harness provides this missing infrastructure:

- Multiple OSDs
- Messaging
- Single threaded event loop for consistency.
- Event loop can be single stepped or intercepted.

New test infrastructure files:
- ECPeeringTestFixture.cc/h: Test fixture for EC peering tests
- PGBackendTestFixture.cc/h: Test fixture for PGBackend tests
- EventLoop.h: Simple event loop for test message dispatch
- OSDMapTestHelpers.h: Helper functions for OSDMap test setup

New test files:
- TestBackendBasics.cc: Basic PGBackend unit tests
- TestECFailoverWithPeering.cc: EC failover tests with full peering

Signed-off-by: Alex Ainscow <aainscow@uk.ibm.com>
19 files changed:
src/test/osd/CMakeLists.txt
src/test/osd/ECPeeringTestFixture.cc [new file with mode: 0644]
src/test/osd/ECPeeringTestFixture.h [new file with mode: 0644]
src/test/osd/EventLoop.h [new file with mode: 0644]
src/test/osd/MockConnection.h
src/test/osd/MockECReadPred.h
src/test/osd/MockECRecPred.h
src/test/osd/MockLog.h [deleted file]
src/test/osd/MockPGBackend.h
src/test/osd/MockPGBackendListener.h
src/test/osd/MockPGLogEntryHandler.h
src/test/osd/MockPeeringListener.h
src/test/osd/OSDMapTestHelpers.h [new file with mode: 0644]
src/test/osd/PGBackendTestFixture.cc [new file with mode: 0644]
src/test/osd/PGBackendTestFixture.h [new file with mode: 0644]
src/test/osd/TestBackendBasics.cc [new file with mode: 0644]
src/test/osd/TestCommon.h [new file with mode: 0644]
src/test/osd/TestECFailoverWithPeering.cc [new file with mode: 0644]
src/test/osd/TestPeeringState.cc