test(storcli2): on-hardware e2e harness + sibling layout#74
Conversation
326c95c to
0ade4e4
Compare
acda7a8 to
1a82eff
Compare
|
LGTM — clean integration harness. Error handling follows existing patterns (pkg/errors wrapping, errors.Is chain traversal through core wrappers). Deferred cleanup in Scenario is correctly scoped after Create. Safety guards (-confirm) and build-only CI job are appropriate. |
0ade4e4 to
0ae498e
Compare
1a82eff to
e75c6c0
Compare
|
0ae498e to
0c6c272
Compare
e75c6c0 to
0c6c272
Compare
|
LGTM |
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
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
96db516 to
8c539d3
Compare
88c82db to
e65ed74
Compare
|
|
Check this one before merging: #74 (comment) |
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
|
|
||
| _, err = tester.Create(ctx, level, parseDrives(opts.drives, opts.controllerID)) | ||
|
|
||
| return err |
There was a problem hiding this comment.
-drives is not validated for create, add, or scenario, unlike -vd which is checked for add/delete. If -drives is omitted, parseDrives returns an empty slice. For scenario this leads to an unguarded drives[0] panic in hardware_raid_controller.go:162; for create/add the adapter gets an empty list and produces a confusing error.
| return err | |
| case "create": | |
| level, err := parseRAIDLevel(opts.raidLevel) | |
| if err != nil { | |
| return err | |
| } | |
| if opts.drives == "" { | |
| return errors.New("create requires -drives") | |
| } | |
Same pattern needed for add (line 125) and scenario (line 133).
— Claude Code
|
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.
storcli2 harness — argument-driven
-confirm:create,add(expand),delete, and a fullscenario(create → assert drive-removal unsupported → optional expand → delete).ErrFunctionNotSupportedByImplementation) rather than mutating the array.-binary(point it atperccli2for PERC).Notes / deviations from the ticket
tests/e2e-storcli2/— per request, both adapters now sit side by side undertests/integration/{mdadm,storcli2}/for clarity.-confirm, as discussed.pkg/implementation/...andpkg/core(notpkg/infrastructure); cross-compile line documented in the README andmain.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.Issue: ARTESCA-17652
🤖 Generated with Claude Code