Skip to content

test(conformance): check that a cached policy DNS address takes new connections - #5651

Draft
matthewgrossman wants to merge 4 commits into
mainfrom
test/4674-policy-dns-cached-address/matthewgrossman
Draft

matthewgrossman wants to merge 4 commits into
mainfrom
test/4674-policy-dns-cached-address/matthewgrossman

Conversation

@matthewgrossman

@matthewgrossman matthewgrossman commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds a regression test for #4674: a client that keeps a policy DNS address, as libcurl and the JDK do, must still be able to open new connections to it while the policy allows the name. The test is expected to fail on main today; it is a draft to show the failure in CI.

Related Issue

Refs #4674 (the test only; the fix is separate).

Changes

  • New conformance suite policy_dns with cached_address_takes_new_connections. It resolves host.openshell.internal in a sandbox, connects to the synthetic address, waits 33 s without a new lookup, and connects again. It also checks that a synthetic address policy DNS never handed out is refused.
  • Policy DNS runs in the sandbox runtime every driver uses, so the test is in conformance and runs on every conformance row (Docker, Podman, k3s, k3s-ha, and the host lanes).

Why 33 s

  • Policy DNS gives a host alias such as host.openshell.internal a mapping that expires exactly 30 s after the lookup (MAX_MAPPING_TTL in crates/openshell-supervisor-network/src/policy_dns/mod.rs), with no grace period.
  • 33 s outlasts that by a few seconds, so the test fails today however long the exec calls take. The wait starts after the first connection returns, so the address is older still when the test reuses it.
  • It can't be shorter. Other names take their upstream DNS TTL (1–30 s), but a conformance test can't control the sandbox's upstream resolver, and the host server is reachable only through the host alias.
  • The wait checks that an address outlasts the current 30 s limit, not a particular longer lifetime such as libcurl's 60 s. A unit test with an injected clock, added with the fix, should cover the exact lifetime the fix guarantees.

Testing

  • cargo clippy and cargo fmt --check on the conformance crate
  • Local tmachine run on ubuntu-docker-rootful with a 45 s wait: fails as expected; the connection right after the lookup succeeds and the later one gets EACCES
  • Branch E2E with a 45 s wait: every conformance row and host lane fails only this test, at the second connection, with PermissionError: [Errno 13] Permission denied
  • Branch E2E with the 33 s wait: same failure expected

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

…ections

A client that keeps a policy DNS address past the mapping's lifetime is refused on a host the policy allows (#4674). Add a features suite that resolves host.openshell.internal, connects, waits 45 s, and connects again to the same address, and run it on the Docker and Podman rows.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Nov 17, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@matthewgrossman matthewgrossman added the test:e2e Requires end-to-end coverage label Nov 17, 2026
@matthewgrossman

Copy link
Copy Markdown
Member Author

/ok to test 24a4e09

@github-actions github-actions Bot added the state:accepted A maintainer decided OpenShell should pursue this issue label Nov 17, 2026
@github-actions

Copy link
Copy Markdown

Label test:e2e applied for 24a4e09. Open Branch E2E Checks, find the run for commit 24a4e09, and click Re-run all jobs to execute with the label set. The run will execute the standard E2E suite after building the required gateway, sandbox, and supervisor images once. The matching required CI gate status on this PR will flip green automatically once the run finishes.

…ance

Policy DNS runs in the sandbox runtime every driver uses, so the test belongs in conformance and runs on every conformance row, including k3s and k3s-ha.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
@matthewgrossman matthewgrossman changed the title test(features): check that a cached policy DNS address takes new connections test(conformance): check that a cached policy DNS address takes new connections Nov 17, 2026
@matthewgrossman

Copy link
Copy Markdown
Member Author

/ok to test 7179707

The move to conformance restored the workflow and the features lockfile from a newer main. Restore them from the branch base so the PR only adds the conformance test.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
@matthewgrossman

Copy link
Copy Markdown
Member Author

/ok to test 980b957

The host alias mapping expires exactly 30 s after the lookup, so 33 s is enough to show the expiry and keeps the test shorter. The comment explains the choice.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
@matthewgrossman

Copy link
Copy Markdown
Member Author

/ok to test 9c71fa7

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:accepted A maintainer decided OpenShell should pursue this issue test:e2e Requires end-to-end coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant