Skip to content

DAOS-18304 ddb: add C unit tests for ddb_run_open#18214

Open
knard38 wants to merge 2 commits into
masterfrom
ckochhof/fix/master/daos-18304-patch-003
Open

DAOS-18304 ddb: add C unit tests for ddb_run_open#18214
knard38 wants to merge 2 commits into
masterfrom
ckochhof/fix/master/daos-18304-patch-003

Conversation

@knard38
Copy link
Copy Markdown
Contributor

@knard38 knard38 commented May 11, 2026

Description

This PR adds C-level unit tests for ddb_run_open and the DDB_CAN_PROCEED error path. It is a follow-up to #18124 and complements #18086 (Go unit tests).

Integration tests (ddb_commands_tests.c): cover ddb_run_open with a real VOS pool — invalid path (-DER_INVAL), read-only open, write-mode open, and already-open (-DER_BUSY).

Unit tests (ddb_commands_ut.c): use --wrap=vmd_wa_can_proceed in ddb_ut to exercise the DDB_CAN_PROCEED macro returning -DER_NO_SERVICE — a path unreachable in integration tests since vmd_wa_can_proceed() always returns true without daos_nvme.conf. Also tests ddb_run_version and
ddb_run_close in isolation.

Steps for the author:

  • Commit message follows the guidelines.
  • Appropriate Features or Test-tag pragmas were used.
  • Appropriate Functional Test Stages were run.
  • At least two positive code reviews including at least one code owner from each category referenced in the PR.
  • Testing is complete. If necessary, forced-landing label added and a reason added in a comment.

After all prior steps are complete:

  • Gatekeeper requested (daos-gatekeeper added as a reviewer).

@knard38 knard38 self-assigned this May 11, 2026
@github-actions
Copy link
Copy Markdown

Ticket title is 'Add unit test to ddb go code'
Status is 'In Review'
https://daosio.atlassian.net/browse/DAOS-18304

@knard38 knard38 force-pushed the ckochhof/fix/master/daos-18304-patch-003 branch from 2ebb05b to aaa9e2b Compare May 11, 2026 15:22
Base automatically changed from ckochhof/fix/master/daos-18304-patch-001-split to master May 18, 2026 14:43
Add open_cmd_tests to ddb_commands_tests.c to cover the four main
behaviors of ddb_run_open:
- invalid path returns DER_INVAL
- read-only (CoW) open sets dc_poh valid and dc_write_mode=false
- write-mode open sets dc_poh valid and dc_write_mode=true
- opening a pool that is already open returns DER_BUSY

Signed-off-by: Cedric Koch-Hofer <cedric.koch-hofer@hpe.com>
@knard38 knard38 force-pushed the ckochhof/fix/master/daos-18304-patch-003 branch from aaa9e2b to 357ba4d Compare May 19, 2026 12:20
@knard38 knard38 marked this pull request as ready for review May 19, 2026 14:10
@knard38 knard38 requested review from a team as code owners May 19, 2026 14:11
Add ddb_commands_ut.c with unit tests using --wrap=vmd_wa_can_proceed to
exercise the DDB_CAN_PROCEED error path that cannot be reached in
integration tests (vmd_wa_can_proceed always returns true without nvme
config):

- open_can_proceed_failure: verifies ddb_run_open returns -DER_NO_SERVICE
  when vmd_wa_can_proceed returns false
- version: verifies ddb_run_version prints the version string
- close_not_open: verifies ddb_run_close returns 0 when no pool is open

Register the new test suite in ddb_ut as suite 'b'.

Signed-off-by: Cedric Koch-Hofer <cedric.koch-hofer@hpe.com>
@knard38 knard38 force-pushed the ckochhof/fix/master/daos-18304-patch-003 branch from 9998a74 to 142b909 Compare May 19, 2026 14:13
@knard38 knard38 requested review from Nasf-Fan and janekmi May 19, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants