test(cli): kernel E2E for pasu run#58
Merged
Merged
Conversation
`pasu run` was the most-advertised entry point but had no execution proof:
CI built it and ran three unit tests, while the privileged E2E job only
exercised the pasu-egress binary directly.
Add pasu-cli/tests/run_e2e.rs, mirroring the egress E2E harness (opt-in
PASU_E2E_KERNEL + root, baseline-connectivity skip):
- TN/TP: with a default-deny policy allowing one IP, the wrapped command
reaches the allowed IP and times out on a non-allowlisted one — proving
policy → lowering → dedicated cgroup → eBPF attach → enforcement, end
to end through the actual `pasu` binary.
- fail-closed: a default-allow policy is rejected before the command runs
(non-zero exit, no side effect from the wrapped command).
CI: the privileged eBPF E2E job now builds and runs both E2E targets.
Signed-off-by: Ho Geun Choi <ohyes9711@gmail.com>
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.
Gap
pasu runis the README's first quickstart, but had no execution proof — CI built pasu-cli and ran 3 unit tests, while the privileged E2E job only exercised thepasu-egressbinary directly. (Found during a docs↔implementation audit.)Added
crates/pasu-cli/tests/run_e2e.rs, mirroring the proven egress-E2E harness (opt-inPASU_E2E_KERNEL+ root, baseline-connectivity skip):pasu run -- timeout 5 bash -c 'exec 3<>/dev/tcp/…'reaches the allowed IP and is dropped for a non-allowlisted one — proving policy → lowering → dedicated cgroup → eBPF attach → enforcement end-to-end.default: allowpolicy is rejected before the wrapped command starts (non-zero exit, marker file never created).CI: the privileged eBPF E2E job now builds and runs both E2E targets.