test(wave2): close 5.W03 — DRBD --ping-timeout net-option#1
Conversation
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>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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.
Summary
Pin scenario 5.W03 (
wave2-05-drbd-state-recovery.md):DrbdOptions/Net/ping-timeoutpropagates from any operator scope through the satellite'ssplitDRBDOptionsinto the renderednet { … }block of the resource's.resfile.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:connection {mesh is emitted (single-replica .res would otherwise mask a per-peer regression).net { … ping-timeout 500; … }block (DRBD time encoding is 1/10s; 500 = 50.0s, the UG9 example).DrbdOptions/Net/ping-timeoutLINSTOR key does NOT leak —drbdadmrejects that form on parse.Test plan
go test ./pkg/satellite/ -run TestApplyRendersPingTimeoutIntoNetBlock— PASSgolangci-lint run --new-from-rev=main ./pkg/satellite/...— 0 new issuestests/e2e/) follow-up — out of scope for this PR (unit-only)