Skip to content

DAOS-16311 test: Add C bindings for control API - #17550

Open
mjmac wants to merge 6 commits into
masterfrom
mjmac/DAOS-16311
Open

mjmac wants to merge 6 commits into
masterfrom
mjmac/DAOS-16311

Conversation

@mjmac

@mjmac mjmac commented Feb 11, 2026 •

Copy link
Copy Markdown
Contributor

Use Go's c-shared-library mode to build a .so that
exposes a C API for the Go Control API. The primary
use case for this library is to replace the problematic
dmg helpers test library that uses fork/exec to allow
tests to drive dmg commands and does not play well
with UCX.

libdaos_control.so wraps the pool, system, storage,
server, and checker paths of lib/control, plus fault
injection hooks for the tests. tests_dmg_helpers.c is
rewritten on top of it, so daos_test and the ftest
cmocka helpers stop scraping dmg JSON. One side
effect of this change is that many operations complete
in milliseconds instead of seconds, and therefore some
tests needed to be updated to work properly with the new
timing.

Signed-off-by: Michael MacDonald github@macdonald.cx

@github-actions

Copy link
Copy Markdown

Ticket title is 'C bindings for DAOS control API'
Status is 'In Progress'
Labels: 'ci_2.6_daily,ci_2.6_provider,ci_master_daily,ci_master_provider'
https://daosio.atlassian.net/browse/DAOS-16311

@daosbuild3

Copy link
Copy Markdown
Collaborator

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test with memcheck on EL 8.8 completed with status UNSTABLE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos//view/change-requests/job/PR-17550/2/testReport/

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test bdev with memcheck on EL 8.8 completed with status UNSTABLE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos//view/change-requests/job/PR-17550/2/testReport/

@daosbuild3

Copy link
Copy Markdown
Collaborator

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-17550/2/display/redirect

1 similar comment
@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-17550/2/display/redirect

@daosbuild3

Copy link
Copy Markdown
Collaborator

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test with memcheck on EL 8.8 completed with status UNSTABLE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos//view/change-requests/job/PR-17550/3/testReport/

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test bdev with memcheck on EL 8.8 completed with status UNSTABLE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos//view/change-requests/job/PR-17550/3/testReport/

@daosbuild3

Copy link
Copy Markdown
Collaborator

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test with memcheck on EL 8.8 completed with status UNSTABLE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos//view/change-requests/job/PR-17550/4/testReport/

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test bdev with memcheck on EL 8.8 completed with status UNSTABLE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos//view/change-requests/job/PR-17550/4/testReport/

@daosbuild3

Copy link
Copy Markdown
Collaborator

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-17550/4/display/redirect

1 similar comment
@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-17550/4/display/redirect

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test bdev with memcheck on EL 8.8 completed with status UNSTABLE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos//view/change-requests/job/PR-17550/5/testReport/

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test with memcheck on EL 8.8 completed with status UNSTABLE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos//view/change-requests/job/PR-17550/5/testReport/

@daosbuild3

Copy link
Copy Markdown
Collaborator

@daosbuild3

Copy link
Copy Markdown
Collaborator

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test with memcheck on EL 8.8 completed with status UNSTABLE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos//view/change-requests/job/PR-17550/6/testReport/

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test bdev with memcheck on EL 8.8 completed with status UNSTABLE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos//view/change-requests/job/PR-17550/6/testReport/

@daosbuild3

Copy link
Copy Markdown
Collaborator

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-17550/6/display/redirect

1 similar comment
@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-17550/6/display/redirect

@mjmac
mjmac force-pushed the mjmac/DAOS-16311 branch from 799f81e to f373e5c Compare July 26, 2026 01:44
@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional Hardware Large MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17550/54/execution/node/1662/log

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional Hardware Medium Verbs Provider MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17550/54/execution/node/1672/log

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional Hardware Medium MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17550/54/execution/node/1682/log

@mjmac
mjmac force-pushed the mjmac/DAOS-16311 branch from f373e5c to fd5ae50 Compare July 27, 2026 21:43
@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional Hardware Medium MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17550/55/execution/node/1755/log

@mjmac
mjmac force-pushed the mjmac/DAOS-16311 branch from fd5ae50 to bc4072d Compare July 28, 2026 18:13
@mjmac
mjmac force-pushed the mjmac/DAOS-16311 branch 2 times, most recently from 6a1ebe9 to 51863fd Compare August 5, 2026 12:27
@daosbuild3

Copy link
Copy Markdown
Collaborator

mjmac added 3 commits August 12, 2026 14:47
Use Go's c-shared-library mode to build a .so that
exposes a C API for the Go Control API. The initial
use case for this library is to replace the problematic
dmg helpers test library that uses fork/exec to allow
tests to drive dmg commands.

Skip-hw-medium-ucx-provider: false
Features: cat_recov
Signed-off-by: Michael MacDonald <github@macdonald.cx>
  * daos_pool|daos_rebuild_ec: Don't escape self_heal prop value
  * control/server.go: Raw %v logging panics on nil; just remove it

Signed-off-by: Michael MacDonald <github@macdonald.cx>
Update the cat_recov suite to work better with the new
libdaos_control bindings, which operate more quickly and
correctly than the old fork/exec dmg wrappers.

- Check repair takes the CIA_ action value directly, where the old
  dmg CLI translated a selection index into the action.
- The bindings answer queries in milliseconds where the fork/exec dmg
  helpers took 1-2s, which throws off some of the timing assumptions
  in the tests. Adjust to use a wall-clock budget instead of counting
  query iterations.
- Pool-not-found now maps to DER_NONEXIST instead of DER_MISC, so
  cr_cleanup no longer needs to tolerate DER_MISC.
- Switch SystemCheckDisable() to use Force: true on SystemStop(),
  matching the current system default and avoiding hangs on shutdown.
- Misc correctness fixes in the gRPC handlers for
  SystemCheck(Enable|Disable).

Skip-hw-medium-ucx-provider: false
Features: cat_recov daos_core_test_nvme
Signed-off-by: Michael MacDonald <github@macdonald.cx>
@mjmac
mjmac force-pushed the mjmac/DAOS-16311 branch from 51863fd to 9a7e563 Compare August 12, 2026 18:50
@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional Hardware Medium Verbs Provider MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17550/59/execution/node/1755/log

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional Hardware Medium MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17550/59/execution/node/1702/log

@mjmac

mjmac commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

The last few test runs have used the following pragmas:
Skip-hw-medium-ucx-provider: false
Features: cat_recov daos_core_test_nvme

The intent here was to really soak the verbs testing and the parts of the test framework that aren't normally run with the standard pr tag (those got run too, as Features is additive on top). I'm confident that the changes here don't introduce any new regressions, and the third commit fixes a few things.

Best I can tell, the two failures are pre-existing CR failures in the following tests:

  • test_stale_entry (check leader resumed instead of starting fresh)
  • cat_recov_core (fiddly query vs. destroy race)

At this point, I think it's time to try and get this landed.

@mjmac mjmac changed the title DAOS-16311 control: Add C bindings for control API DAOS-16311 test: Add C bindings for control API Aug 27, 2026
@mjmac
mjmac marked this pull request as ready for review August 27, 2026 19:08
@mjmac
mjmac requested review from a team as code owners August 27, 2026 19:08

@daltonbohning daltonbohning left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just reviewed ftest and NLT code. Overall seems sane

Comment on lines +362 to +364
# Scope by pool UUID: resolved findings from prior checker instances survive
# disable/enable and reuse pool labels (DAOS-18773).
check_query_out = dmg_command.check_query(pool=pool_1.uuid)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we push an independent fix for this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also prefer an independent fix.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped this as it was fixed by Kris' PR.

Comment thread src/tests/nlt/config.py Outdated
Comment on lines +147 to +148
control_so = join(conf['PREFIX'], 'lib64', 'libdaos_control.so')
if os.path.exists(control_so):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we error if it does not exist?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, fixed.

@kjacque kjacque left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we pull the unrelated test and checker fixes out into separate PRs? Or are they just silencing bugs so you can get a better read on whether the control lib is working correctly?

Comment thread src/common/tests_dmg_helpers.c Outdated
D_FREE(acl_str[i]);

D_FREE(acl_str);
dmg_ctx_init(const char *cfg, uintptr_t *ctx)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This becomes sort of an intermediate step in this transformation, right? We should probably replace the name "dmg" in this filename and function names to "control" since it talks to the control lib instead.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I just went ahead and renamed everything. Might as well do it now.

Comment on lines +362 to +364
# Scope by pool UUID: resolved findings from prior checker instances survive
# disable/enable and reuse pool labels (DAOS-18773).
check_query_out = dmg_command.check_query(pool=pool_1.uuid)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also prefer an independent fix.

mjmac added 3 commits November 6, 2026 22:37
# Conflicts:
#	src/control/server/mgmt_check_test.go
  * check_start_corner_case.py: drop the pool-scoped query workaround
    now that DAOS-18773 clears stale reports between cases
  * nlt/config.py: require a valgrind-tagged libdaos_control.so
  * control/c: cover whole-system stop/start failure paths
  * mgmt_check.go: restore the disableChecker error text

Signed-off-by: Michael MacDonald <mjmac@vectorsolutionsgroup.com>
The helpers call libdaos_control directly; nothing on the path runs
dmg any more, so the old prefix misdescribes what the tests depend on.

Skip-hw-medium-ucx-provider: false
Features: cat_recov daos_core_test_nvme
Signed-off-by: Michael MacDonald <mjmac@vectorsolutionsgroup.com>

This branch has not been deployed

No deployments
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.

5 participants