Skip to content

test(storcli2): on-hardware e2e harness + sibling layout#74

Open
g-carre wants to merge 4 commits into
feature/storcli2-raidcontroller-compositionfrom
feature/storcli2-integration-tests
Open

test(storcli2): on-hardware e2e harness + sibling layout#74
g-carre wants to merge 4 commits into
feature/storcli2-raidcontroller-compositionfrom
feature/storcli2-integration-tests

Conversation

@g-carre

@g-carre g-carre commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a manual on-hardware e2e harness for the storcli2/perccli2 composition adapter (ARTESCA-17652) and reorganizes the integration harnesses so each adapter is clearly identifiable in its own sibling directory. Stacked on #73.

tests/integration/
  mdadm/      # moved: existing software-RAID (RHEL8/mdadm) harness
  storcli2/   # new: MegaRAID/PERC harness
  README.md   # documents both + cross-compile line

storcli2 harness — argument-driven

  • Default (no args): read-only inventory — lists controllers, physical drives and logical volumes as markdown tables. Safe to run anywhere.
  • Destructive commands require -confirm: create, add (expand), delete, and a full scenario (create → assert drive-removal unsupported → optional expand → delete).
  • storcli2 can't remove drives, so the scenario exercises removal as a negative case (asserts ErrFunctionNotSupportedByImplementation) rather than mutating the array.
  • The same composition serves both binaries via -binary (point it at perccli2 for PERC).

Notes / deviations from the ticket

  • Layout differs from the ticket's suggested tests/e2e-storcli2/ — per request, both adapters now sit side by side under tests/integration/{mdadm,storcli2}/ for clarity.
  • Scope is a superset of the ticket's read-only inventory: it keeps inventory as the default but adds opt-in destructive tasks/scenario behind -confirm, as discussed.
  • Imports only pkg/implementation/... and pkg/core (not pkg/infrastructure); cross-compile line documented in the README and main.go.

Testing

go build ./..., go vet ./tests/integration/..., gofmt, and the full unit suite pass. Verified locally that the default inventory fails gracefully (no panic) when the binary is absent, and that destructive commands refuse to run without -confirm.

Note: Targets feature/storcli2-raidcontroller-composition (#73), not main, per the stack.

Issue: ARTESCA-17652

🤖 Generated with Claude Code

Add a manual on-hardware harness for the storcli2/perccli2 composition
adapter and reorganise the integration harnesses so each adapter lives in
its own clearly-identifiable sibling directory:

- tests/integration/mdadm/    (moved existing software-RAID harness)
- tests/integration/storcli2/ (new)

The storcli2 harness is argument-driven: a bare invocation is read-only and
prints the controller / physical-drive / logical-volume inventory as markdown
tables; create, add, delete and the full create -> assert-remove-unsupported
-> expand -> delete scenario are destructive and run only with -confirm. Drive
removal is exercised as a negative case since storcli2 does not support it. The
same composition serves storcli2 and perccli2 via the -binary flag.

A README documents both harnesses and the cross-compile build line.

Issue: ARTESCA-17652
@g-carre g-carre requested a review from a team as a code owner June 25, 2026 11:53
g-carre added 3 commits June 25, 2026 14:02
Add `make build-e2e-mdadm`, `make build-e2e-storcli2` and the aggregate
`make build-e2e` (also wired into `make all`) to build the on-hardware
integration harnesses into bin/. The harnesses are manual and destructive, so
they are never run in CI, but a new build-e2e pre-merge job compiles them so a
change to the adapters cannot silently break them.

Ignore the bin/ build output directory.

Issue: ARTESCA-17652
Satisfy the prealloc linter by sizing the drives slice to the parsed parts
instead of growing it from nil.

Issue: ARTESCA-17652
Build the e2e harnesses with CGO disabled for linux/amd64 so the resulting
binaries are statically linked and depend on no glibc, letting a single binary
run on both Rocky Linux 8 (glibc 2.28) and Rocky Linux 9 (glibc 2.34). The
target is overridable via E2E_GOOS / E2E_GOARCH. Update the README accordingly.

Issue: ARTESCA-17652
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