Skip to content

testdata: keep state-changing storcli2 captures out of SAFE mode#60

Merged
g-carre merged 1 commit into
mainfrom
improvement/storcli2-testdata-collect-fixes
Jun 15, 2026
Merged

testdata: keep state-changing storcli2 captures out of SAFE mode#60
g-carre merged 1 commit into
mainfrom
improvement/storcli2-testdata-collect-fixes

Conversation

@ezekiel-alexrod

Copy link
Copy Markdown
Contributor

What

Makes the storcli2 collect script's SAFE mode actually read-only, and fixes the testdata staleness found in review.

Why

The script header and the README promised that SAFE mode (the default) only collects read-only outputs, yet six captures issuing state-changing verbs ran unconditionally: start/stop locate (drive LED), set/delete jbod, the delete-nonexistent-VD and the migrate failure cases. They are only expected to fail or toggle an LED on the reference setup, but on a host where their target exists (an unconfigured slot 0, a VD 999) they would really change the configuration.

How

  • Move the six captures into the DESTRUCTIVE=true block; SAFE mode is now strictly show commands. README Mode column aligned with the actual behavior.
  • Rename controllergetter/testdata/storcli2/c0_s12_UGood.jsonc0_UGood.json: the captured unconfigured drive is e320:s11 (auto-detected at capture time), so a slot-specific name is misleading. Not referenced by any test.
  • Rename cacheoptions/success.jsoncombined_syntax_error.json: it records the v1 combined set rdcache=RA wrcache=WT syntax that storcli2 rejects with a plain-text syntax error, not a success payload. README "Known issues" updated.
  • Sync VD_IDS with the live controller: VDs are 1-23 and 25 — the original v24 was sacrificed by a destructive capture run and recreated as v25 (the per-VD list stopped at 23).
  • Document the c0_aso.json / c0_autoconfig.json captures in the README mapping table and drop the stale "command logic is unchanged" claim.

bash -n clean; go test ./pkg/... green (the two renamed fixtures are not referenced by tests).

The collect script's header and README promised that SAFE mode (the default)
only collects read-only outputs, yet six captures issuing state-changing verbs
ran unconditionally: start/stop locate (drive LED), set/delete jbod, the
delete-nonexistent-VD and the migrate failure cases. They are only expected to
fail or toggle an LED on the reference setup, but on a host where their target
exists (an unconfigured slot 0, a VD 999) they would really change the
configuration. Move them into the DESTRUCTIVE block so SAFE mode is strictly
"show" commands, and align the README's Mode column with the actual behavior.

Also fix the surrounding staleness found in review:

- Rename controllergetter's c0_s12_UGood.json to c0_UGood.json: the captured
  unconfigured drive is e320:s11 (auto-detected at capture time), so a
  slot-specific name is misleading.
- Rename cacheoptions/success.json to combined_syntax_error.json: it records
  the v1 combined "set rdcache=RA wrcache=WT" syntax that storcli2 rejects
  with a plain-text syntax error, not a success payload.
- Sync VD_IDS with the live controller: VDs are 1-23 and 25 (the original
  v24 was sacrificed by a destructive run and recreated as v25; the per-VD
  list stopped at 23).
- Document the c0_aso.json / c0_autoconfig.json captures in the README mapping
  table and drop the stale "command logic is unchanged" claim.
@ezekiel-alexrod ezekiel-alexrod requested a review from a team as a code owner June 12, 2026 09:46

@g-carre g-carre 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.

LGTM

@g-carre g-carre merged commit a85c930 into main Jun 15, 2026
3 checks passed
@g-carre g-carre deleted the improvement/storcli2-testdata-collect-fixes branch June 15, 2026 14:05
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.

2 participants