Repository navigation
test(e2e): drive every write path against a real esxi node - #206
Merged
Merged
Conversation
Adds test/e2e/esxi (task e2e:esxi): a scripted run that stands up a throwaway Fleet Manager against a throwaway Postgres container, bootstraps it with its own throwaway operator CA, links it to nodes a lab gate run already installed, and drives profile, protocol, certificate, config-push, image-status, SCEP-challenge, re-key, escrow, enrolment, operator-credential and decommission write paths, checking each result on the node itself. Reuses internal/nodeclient and internal/config rather than inventing new node-dialing or config code, and generates its own ECDSA P-384 operator CA in memory for the run since the manager's operator CA is always external. A smoke run against a real throwaway manager and Postgres container (no real CryptOS node reachable from here) found two certificate bugs the real oracle (internal/operatorca.ValidateAnchor and CheckOperatorCert) now guards against in the test suite: the throwaway operator CA needs over 30 days of validity to register, and every signed credential needs an explicit basicConstraints CA:FALSE, not merely absent. The live run against real nodes still waits on cryptos-appliance#53 (blocked on an unmerged dependency); this change only adds the harness and proves it with a reachable-but-fake node. Refs #38 Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
Bugs5382
marked this pull request as ready for review
October 15, 2026 20:11
Contributor
Author
|
Filed the follow-up for the two scope gaps: #207. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Adds
test/e2e/esxi(task e2e:esxi): a scripted run that exercises every write path the FleetManager's public API exposes, live, against real CryptOS nodes a lab gate run (or the cryptos-lab
tooling) already installed, checking each result on the node itself rather than trusting the
manager's own view of it.
It stands up a throwaway Fleet Manager against a throwaway Postgres container (the operator-CA and
operator-credential write paths only wire up with a database, not the in-memory store), bootstraps
it with its own throwaway operator CA generated in memory for the run, links it to the given nodes,
and drives: profile create/apply/update/requestable/delete, a protocol toggle, certificate issue and
revoke, a config-push round trip, image status (stage/activate/rollback when a signed release image
is supplied), SCEP challenge mint/list/revoke, re-key (opt-in, destructive), escrow export/import,
node enrolment link and reject, the full operator-credential lifecycle, and decommission.
It reuses
internal/nodeclientandinternal/configrather than inventing new node-dialing orconfig code, matching the manager's own shape for node credentials.
Refs #38
Scope not covered yet
signature; without
E2E_IMAGE_URL/E2E_IMAGE_SIGNATURE_PATHthis run only provesGetNodeImageStatus.(
ApproveNodeScepEnrollment/RejectNodeScepEnrollment) needs a real RFC 8894 SCEP client talkingto the node; this run proves challenge minting, listing and revocation only. I'll file a follow-up
issue for both.
blocked behind an unmerged dependency); this PR only adds the harness.
Verification
How this was verified
task fmt,task vet,go build ./...,golangci-lint run ./...(0 issues) andtask test(whole repo) all pass.
task license(golic dry run): 0/282 files need a header change.docker run postgres:18-alpine, thentask e2e:esxiagainst one node entry whose endpoint is unreachable (no real CryptOS node is reachable from
here). The manager started for real, printed and consumed its bootstrap token, registered this
script's operator CA, submitted and recorded the first admin certificate, and ran every step in
order; the steps needing a live node failed with the manager's own node-unreachable codes (1100,
1900), exactly as expected, and
operator-credentials/request-record-revoke-cancelpassed infull against the real running manager.
this description: the throwaway operator CA needs over 30 days of validity to register (the
manager refuses under 30 with 1605 EXPIRING), and every signed operator credential needs an
explicit
basicConstraintsCA:FALSE, not merely absent (1610 BASIC_CONSTRAINTS). Both arefixed, and
credentials_test.gonow runs every generated certificate through the manager's owninternal/operatorca.ValidateAnchorandCheckOperatorCertas the oracle, so a regression herefails in
task test, not only in a live run.docs/e2e-esxi.md): every command block in it was run in the clean environment above(fresh Postgres container, fresh work directory) before marking this ready.
Before merging: add a closing comment summarizing what was actually done in this PR
(not just the checked boxes).