Skip to content

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

Draft
knard38 wants to merge 1 commit into
ckochhof/fix/master/daos-18304-patch-001-splitfrom
ckochhof/fix/master/daos-18304-patch-003
Draft

DAOS-18304 ddb: add C unit tests for ddb_run_open#18214
knard38 wants to merge 1 commit into
ckochhof/fix/master/daos-18304-patch-001-splitfrom
ckochhof/fix/master/daos-18304-patch-003

Conversation

@knard38
Copy link
Copy Markdown
Contributor

@knard38 knard38 commented May 11, 2026

Description

This PR builds on top of #18124.
While working on that refactoring, it became apparent that ddb_run_open lacked C-level unit test coverage.
This patch addresses that gap.

It adds open_cmd_tests to ddb_commands_tests.c, covering the four main behaviors of ddb_run_open:

  • Invalid path: opening a non-existent VOS file returns DER_INVAL.
  • Read-only open: a successful open with write_mode=false leaves dc_poh valid and dc_write_mode set to false in the context.
  • Write-mode open: a successful open with write_mode=true leaves dc_poh valid and dc_write_mode set to true in the context.
  • Pool already open: attempting to open a pool when one is already open returns DER_BUSY.

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

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 2ebb05b to aaa9e2b Compare May 11, 2026 15:22
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