Commit 8158c4b
fix(e2e): honor managed gateway unit path (#9261)
<!-- markdownlint-disable MD041 -->
## Summary
The protected Portable Profile `systemctl` fixture now reads the
OpenShell gateway binary selected by the managed user service instead of
assuming the user XDG bin directory. It accepts only the three
installer-owned locations and rejects ambiguous or untrusted service
identities.
This restores the portable-launch fixture after automatic run
`31969858915`, job `95220512323`, rejected a valid
`/usr/local/bin/openshell-gateway` unit. The immutable artifact is
`9269507500` with digest
`sha256:2bc324b785af9d93abef8dc3a4bc4da38b4c2d30f51e7f88838e8cf0cd6315e0`.
## Related Issue
Relates #9208.
## Changes
- Read exactly one absolute `ExecStart` path from the managed OpenShell
gateway user service.
- Accept only the installer-supported XDG user bin, `/usr/local/bin`, or
`/usr/bin` gateway locations.
- Keep the exact `ExecStartPre`, unit marker, environment, file type,
permission, and symlink checks fail closed.
- Cover both system locations and an untrusted path with deterministic
fixture tests.
## Type of Change
- [x] Code change (feature, bug fix, or refactor)
- [ ] Code change with doc updates
- [ ] Doc only (prose changes, no code sample modifications)
- [ ] Doc only (includes code sample changes)
## Quality Gates
- [x] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [ ] Tests not applicable — justification:
- [ ] Docs updated for user-facing behavior changes
- [x] Docs not applicable — justification: This changes only the
protected Portable Profile E2E fixture and its deterministic support
coverage; production and supported user behavior are unchanged.
- [x] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [x] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification: Independent
nine-category security review of commit `6b8fc44b8` passed with no
findings; the path allowlist matches installer authority and preserves
existing unit, environment, process-identity, logging, and cleanup
controls.
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:
## Documentation Writer Review
- [x] Documentation writer subagent reviewed the completed changes
- Result: `no-docs-needed`
- Evidence: Independent Pi CLI review covered the complete two-file PR
diff at latest PR commit `338dd2fd6`. The change is limited to an
internal E2E fixture and support tests for installer-selected OpenShell
gateway paths. It changes no public command, configuration, workflow,
default, or supported behavior. The conflict-free main merge
incorporates the terminal-test fix required by CI.
- Agent: Pi CLI
<!-- docs-review-head-sha: 338dd2f -->
<!-- docs-review-agents-blob-sha: e30afb2 -->
## DGX Station Hardware Evidence
- [ ] Tested on DGX Station
- Tested commit:
- Station profile/scenario:
- Result:
- Supporting evidence:
## Verification
- [x] PR description includes a `Signed-off-by:` line and every commit
appears as `Verified` in GitHub
- [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or
`npm run validate:pr` passed after refreshing `origin/main` when hooks
were skipped or unavailable
- [x] Targeted behavior tests pass for the current change set, or tests
are marked not applicable above — command/result or justification:
`./node_modules/.bin/vitest run --project e2e-support
test/e2e/support/portable-profile-systemctl-shim.test.ts` passed 30/30
on exact current main.
- [ ] Applicable broad gate passed — `npm test` for broad
runtime/test-harness changes; `npm run check` for repo-wide
validation/coverage changes — command/result: Not applicable to this
two-file fixture repair. Current-main `checks:repository`, CLI
typecheck, source-shape, test-size, conditional, test-loop, and scoped
normal hooks passed.
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only)
- [ ] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)
---
Signed-off-by: Senthil Ravichandran <senthilr@nvidia.com>
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved validation of the managed gateway service configuration.
* Gateway binaries must now use trusted system locations and be regular,
readable executables.
* Added checks to ensure service start commands consistently reference
the configured gateway binary.
* Improved error reporting when the gateway identity or executable
configuration is invalid.
* **Tests**
* Added coverage for valid gateway paths in trusted locations.
* Added validation for rejecting untrusted paths and missing executable
output.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Signed-off-by: Senthil Ravichandran <senthilr@nvidia.com>
Co-authored-by: Carlos Villela <cvillela@nvidia.com>1 parent 2d03922 commit 8158c4b
2 files changed
Lines changed: 88 additions & 5 deletions
File tree
- test/e2e
- fixtures
- support
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
460 | 460 | | |
461 | 461 | | |
462 | 462 | | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
463 | 491 | | |
464 | 492 | | |
465 | 493 | | |
| |||
469 | 497 | | |
470 | 498 | | |
471 | 499 | | |
472 | | - | |
473 | | - | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
474 | 507 | | |
475 | 508 | | |
476 | 509 | | |
477 | | - | |
478 | | - | |
| 510 | + | |
| 511 | + | |
479 | 512 | | |
480 | 513 | | |
| 514 | + | |
481 | 515 | | |
482 | 516 | | |
483 | 517 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
244 | 262 | | |
245 | 263 | | |
246 | 264 | | |
| |||
434 | 452 | | |
435 | 453 | | |
436 | 454 | | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
437 | 486 | | |
438 | 487 | | |
439 | 488 | | |
| |||
0 commit comments