Repository navigation
test(e2e): keep only NemoClaw's retention promise in the Kubernetes destroy checks - #13422
Merged
Merged
Conversation
The gateway refusing an expired token is OpenShell's behavior, and the Helm release and StatefulSet disappearing after destroy is Helm's and Kubernetes'. NemoClaw's part, keeping the namespace, encryption key and gateway claims across destroy, stays.
Contributor
cv
added a commit
that referenced
this pull request
Oct 26, 2026
…en is refused (#13632) Part of #12734. It builds on #13551, now merged. ## Failure The Kind OIDC test used one token for apply, export and destroy, so no live run showed that NemoClaw reads `token.env` again on each command, the renewal docs/kubernetes.md documents ("When the token expires, get a new one and rerun"). The refused plan was checked only for not echoing the token: nothing showed that a refusal leaves state alone or that no token reaches the state directory. The issuer's namespace was deleted only after every check passed. ## Decision ```mermaid flowchart LR K["issuer key<br/>nc-issuer-* namespace"] -->|first token| A["Deployment 1<br/>apply"] K -->|other audience| R["Deployment 2<br/>plan: refused"] K -->|rotated token, 1 s later| P["Deployment 3<br/>plan: no changes<br/>export = document<br/>destroy"] A --> R --> P --> S["no token in any<br/>state file"] R -.- U["intent.json, tfstate, kubernetes/<br/>byte-identical; no token in error"] ``` - Refusal: `intent.json`, `terraform.tfstate`, its backup and every file under `kubernetes/` must be byte-identical before and after the foreign-audience plan, with none added or removed, and the error text must hold no token. The refusal surfaces as an OpenTofu execution error, so its wording and class are not checked. Generated configuration, the lock file, saved plans, `.terraform`, `.helm` and `diagnostics/` are left out, because each command writes them. - Rotation: the test signs a second token with the issuer's key one second later, so `iat`, `nbf` and `exp` differ. Only a new Deployment holds it, and it runs plan, export and destroy. - Secrets: after export and after destroy, no regular file in the state directory may contain any of the three tokens. The raw-byte search skips OpenTofu's symbolic links to the bundle and cannot see inside saved plans, which are zip archives. - Cleanup: every assertion runs after destroy. If destroy with the rotated token fails, a separate Deployment with the first token destroys before the test fails. A drop guard deletes the issuer namespace when the test passes or panics, bounded at 15 s; a nextest time-limit kill skips it. - No red test: `a_refused_forward_token_is_an_authentication_failure_without_effects` and `failed_and_partial_observations_retain_protocol_state` cover these promises against fakes, and no defect is known. A token in state, or state changed by a refusal, would be a defect to reproduce at the unit or contract layer first. - Out of scope: expiry enforcement, which #13422 left to OpenShell. - docs/contributing/live-tests.md describes these checks and their limits, and names the token field `token.env` instead of the rejected `tokenEnv`. ## Validation - After merging v1 `62f994bf8`, which holds #13551 and switches the live agent to OpenClaw (#13704), `cargo ci` passed: 156 lifecycle tests. - The real `cargo ci live-kind` with OpenClaw on linux_arm64 passed 7 of 7, including this OIDC test, at 102.6 s. This host runs Kind about 1.5 times slower than a CI runner. - Earlier, on local k3s with Pi, it passed twice at 81.7–85.1 s, about 4 s more than before this change. - Giving the rotated Deployment the other-audience token failed the test, as intended: its operations failed with `observation authentication failed`, which holds no token, and the fallback destroy with the first token succeeded. - Temporary offline tests, not committed, checked the state snapshot, the token search and the guard. Against a server that accepts connections and never answers, the guard returned after 15 s, and after 30 s without the bound. --------- Signed-off-by: Carlos Villela <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Carlos Villela <[email protected]>
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.
Part of #12731. Follows #13421, which merged before this narrowing reached it.
Failure
#13421 added three live Kind checks, two of which test other components:
NemoClaw's part, classifying an authentication failure and having its graph destroy the release, already has unit and plan-level coverage.
Decision
retained().Validation
This commit was tested on #13421's branch, whose code matches the merged #13421:
cargo cipasses locally: 1,589 unit tests and 153 lifecycle tests.cargo ci live-kindpasses locally: all 7 tests.