Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,11 +424,14 @@ Suites:

- Common suite (`--features e2e`) - driver-neutral CLI behavior, sandbox lifecycle, sync, port forwarding, policy, and provider tests.
- Conformance (`tests/suites/conformance`) - the testkit `conformance` crate:
lifecycle, the CLI, persistent workspaces, file transfer, and the policy
advisor. Driver E2E runs it with `openshell-conformance` against the lane's
gateway and writes a JUnit report under `results/`; set
`OPENSHELL_CONFORMANCE_BIN` to use a prebuilt program, as Branch E2E does
with the static build it makes once per architecture. The
lifecycle, the CLI, persistent workspaces, file transfer, the policy
advisor, and credential gating. Driver E2E runs it with
`openshell-conformance` against the lane's gateway and writes a JUnit report
under `results/`; set `OPENSHELL_CONFORMANCE_BIN` to use a prebuilt program,
as Branch E2E does with the static build it makes once per architecture.
The Docker and Podman runners build `openshell/e2e-python:dev` for it; the
Kubernetes and VM runners set `OPENSHELL_TEST_PYTHON_IMAGE` to a pullable
Python image unless it is already set. The
installed-artifact conformance lanes run the same crate through
`openshell-test-runner` (see above).
- Driver suites (`--features e2e-docker`, `e2e-podman`, `e2e-kubernetes`, or
Expand Down Expand Up @@ -656,6 +659,8 @@ explains the isolation backend separation behind the capability-free runtime.
On a **remote** cluster, drop the `e2e-host-gateway` feature. Those tests rely
on the sandbox-side `host.openshell.internal` alias reaching the machine running
the tests, which is unreachable from pods on a remote cluster, so they fail.
The conformance suite's `credential_gating` tests rely on the alias too and
fail on a remote cluster; the feature selection doesn't skip them.
Left enabled, the `host_gateway_alias` suite fails because
`host.openshell.internal` does not resolve inside the pod, so the gateway
SSRF-denies the request (`DNS resolution failed` / `ssrf_denied`) — a networking
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

apiVersion: apps/v1
kind: StatefulSet
metadata:
name: openshell
spec:
template:
spec:
containers:
- name: kubernetes-compute-driver
env:
- name: OPENSHELL_HOST_GATEWAY_IP
value: replaced-by-kustomize
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

# The in-process driver reads server.hostGatewayIP from the rendered gateway
# TOML. The external driver reads it from its own environment, so copy the
# chart's rendered value into that container.
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component
patches:
- path: driver-env-patch.yaml
target:
group: apps
version: v1
kind: StatefulSet
name: openshell
replacements:
- source:
group: apps
version: v1
kind: StatefulSet
name: openshell
fieldPath: spec.template.spec.hostAliases.0.ip
targets:
- select:
group: apps
version: v1
kind: StatefulSet
name: openshell
fieldPaths:
- spec.template.spec.containers.[name=kubernetes-compute-driver].env.[name=OPENSHELL_HOST_GATEWAY_IP].value
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,11 @@ cp "${plugin_dir}/kustomization.yaml" "${work_dir}/kustomization.yaml"
cp "${plugin_dir}/workload-patch.yaml" "${work_dir}/workload-patch.yaml"
tee "${work_dir}/rendered.yaml" >/dev/null

# server.hostGatewayIP renders the gateway pod's hostAliases entry.
if grep -q 'host\.openshell\.internal' "${work_dir}/rendered.yaml" \
&& grep -q '^ *hostAliases:' "${work_dir}/rendered.yaml"; then
cp -R "${plugin_dir}/host-gateway" "${work_dir}/host-gateway"
printf 'components:\n - host-gateway\n' >>"${work_dir}/kustomization.yaml"
fi

kubectl kustomize "${work_dir}"
5 changes: 0 additions & 5 deletions e2e/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,6 @@ name = "websocket_conformance"
path = "tests/websocket_conformance.rs"
required-features = ["e2e-host-gateway"]

[[test]]
name = "credential_gating"
path = "tests/credential_gating.rs"
required-features = ["e2e-host-gateway"]

[[test]]
name = "user_namespaces"
path = "tests/user_namespaces.rs"
Expand Down
6 changes: 3 additions & 3 deletions e2e/rust/e2e-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ if [ "${1:-}" = "${RUN_WITH_GATEWAY_COMMAND}" ]; then
exit 0
fi

if [ "${E2E_FEATURES}" != "e2e-conformance-only" ]; then
CONTAINER_ENGINE=docker bash "${ROOT}/tasks/scripts/e2e-build-workload.sh"
fi
# The conformance suite runs on every lane, including e2e-conformance-only,
# and creates sandboxes from this image (testkit::python_image()).
CONTAINER_ENGINE=docker bash "${ROOT}/tasks/scripts/e2e-build-workload.sh"

exec "${ROOT}/e2e/with-docker-gateway.sh" \
bash "${BASH_SOURCE[0]}" "${RUN_WITH_GATEWAY_COMMAND}"
1 change: 1 addition & 0 deletions e2e/rust/e2e-kubernetes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ run_conformance() {
fi

OPENSHELL_CONFORMANCE_JUNIT="${OPENSHELL_CONFORMANCE_JUNIT:-${ROOT}/results/${OPENSHELL_E2E_REPORT_NAME:-e2e-kubernetes}-conformance.xml}" \
OPENSHELL_TEST_PYTHON_IMAGE="${OPENSHELL_TEST_PYTHON_IMAGE:-${E2E_PULLABLE_PYTHON_IMAGE}}" \
e2e_run_openshell_conformance "Kubernetes"
}

Expand Down
7 changes: 3 additions & 4 deletions e2e/rust/e2e-podman.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ PODMAN_CI_TESTS=(
bypass_detection
ephemeral_cleanup
core_dump_hardening
credential_gating
default_image
driver_config_volume
edge_tunnel_e2e
Expand Down Expand Up @@ -117,9 +116,9 @@ if [ -n "${OPENSHELL_GATEWAY_ENDPOINT:-}" ] && [ -z "${OPENSHELL_BIN:-}" ]; then
export OPENSHELL_BIN="${ROOT}/target/debug/openshell"
fi

if [ "${E2E_FEATURES}" != "e2e-conformance-only" ]; then
CONTAINER_ENGINE=podman bash "${ROOT}/tasks/scripts/e2e-build-workload.sh"
fi
# The conformance suite runs on every lane, including e2e-conformance-only,
# and creates sandboxes from this image (testkit::python_image()).
CONTAINER_ENGINE=podman bash "${ROOT}/tasks/scripts/e2e-build-workload.sh"

exec "${ROOT}/e2e/with-podman-gateway.sh" \
bash "${BASH_SOURCE[0]}" "${RUN_WITH_GATEWAY_COMMAND}"
3 changes: 2 additions & 1 deletion e2e/rust/e2e-vm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,8 @@ e2e_export_gateway_restart_metadata \
# preparation; allow 180s for slower CI runners.
export OPENSHELL_PROVISION_TIMEOUT="${SANDBOX_PROVISION_TIMEOUT}"

e2e_run_openshell_conformance "VM"
OPENSHELL_TEST_PYTHON_IMAGE="${OPENSHELL_TEST_PYTHON_IMAGE:-${E2E_PULLABLE_PYTHON_IMAGE}}" \
e2e_run_openshell_conformance "VM"
if [ "${E2E_FEATURES}" = "e2e-conformance-only" ]; then
echo "::notice::Skipping Rust e2e tests (e2e-conformance-only)"
exit 0
Expand Down
Loading
Loading