Skip to content

test(wave2): close 5.W03 — DRBD --ping-timeout net-option#1

Draft
kvaps wants to merge 1 commit into
mainfrom
wave2/5W03-ping-timeout
Draft

test(wave2): close 5.W03 — DRBD --ping-timeout net-option#1
kvaps wants to merge 1 commit into
mainfrom
wave2/5W03-ping-timeout

Conversation

@kvaps
Copy link
Copy Markdown
Member

@kvaps kvaps commented May 14, 2026

Summary

Pin scenario 5.W03 (wave2-05-drbd-state-recovery.md): DrbdOptions/Net/ping-timeout propagates from any operator scope through the satellite's splitDRBDOptions into the rendered net { … } block of the resource's .res file.

The generic DrbdOptions/Net/* chain was already pinned by 5.W01 (--protocol C). 5.W03 adds operator-scope (linstor node-connection drbd-peer-options --ping-timeout) but the effective-props resolver flattens scope before dispatch, so the renderer contract is scope-agnostic and one test covers controller / RD / node-connection / resource-connection paths uniformly.

Test

pkg/satellite.TestApplyRendersPingTimeoutIntoNetBlock — 2-replica RD (n1↔n2). Asserts:

  • The connection { mesh is emitted (single-replica .res would otherwise mask a per-peer regression).
  • A top-level net { … ping-timeout 500; … } block (DRBD time encoding is 1/10s; 500 = 50.0s, the UG9 example).
  • The unstripped DrbdOptions/Net/ping-timeout LINSTOR key does NOT leak — drbdadm rejects that form on parse.

Test plan

  • go test ./pkg/satellite/ -run TestApplyRendersPingTimeoutIntoNetBlock — PASS
  • golangci-lint run --new-from-rev=main ./pkg/satellite/... — 0 new issues
  • E2E (tests/e2e/) follow-up — out of scope for this PR (unit-only)

Pin scenario 5.W03 (wave2-05-drbd-state-recovery.md): the generic
`DrbdOptions/Net/ping-timeout` propagation chain through the
satellite's `splitDRBDOptions` lands the value verbatim inside the
rendered `net { … }` block as `ping-timeout 500;` (DRBD time
encoding is 1/10s; 500 = 50.0s, the UG9 example).

The chain is already wired by 5.W01 (RD scope, `--protocol C`):
- effectiveprops.Resolve folds controller / RG / RD / Resource
  scopes into one flat prop bag via maps.Copy — no allowlist.
- dispatcher.BuildDesired routes every `DrbdOptions/<Section>/*`
  key into DesiredResource.DrbdOptions verbatim.
- satellite.splitDRBDOptions partitions on the `<Section>` token;
  `Net/*` keys go to drbd.Net.Options, the rest to top-level
  `options { }`.
- drbd.Build emits them sorted into the rendered .res.

5.W03's contribution is operator-scope — `linstor node-connection
drbd-peer-options --ping-timeout` writes the same prop at a
different point in the hierarchy. By the time it reaches the
satellite the bag is flat, so the renderer contract is scope-
agnostic and one test covers controller / RD / node-connection /
resource-connection paths uniformly.

`TestApplyRendersPingTimeoutIntoNetBlock`:
- 2-replica RD on n1↔n2 (single-replica .res has no connection{}
  mesh and would let a regression that only fires on multi-peer
  paths slip past).
- Asserts the `net {` framing exists before grepping the substring
  (catches a renderer regression that suppresses the block
  entirely with a clearer error).
- Asserts the unstripped `DrbdOptions/Net/ping-timeout` key does
  NOT leak — drbdadm rejects that form on parse and the .res
  would refuse to load even though `grep ping-timeout` would
  spuriously pass.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4705ce9a-60bd-4bae-9511-8ecf69f00e07

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch wave2/5W03-ping-timeout

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new unit test, TestApplyRendersPingTimeoutIntoNetBlock, in pkg/satellite/reconciler_drbd_test.go to verify that DRBD ping-timeout options are correctly rendered into the .res file's net block with the appropriate prefix stripping. Additionally, the scenario documentation in tests/scenarios/wave2-05-drbd-state-recovery.md has been updated to reflect this test coverage. I have no feedback to provide as there were no review comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant