Skip to content

Commit 9ab1be1

Browse files
test(testkit): restore openshell/e2e-python:dev as the default test image
The tmachine installers load it and the Docker and Podman lanes build it, so those lanes don't pull an image inside a test's timeout or lose curl, git and openssl. The Kubernetes and VM lanes keep using the pinned public image through OPENSHELL_TEST_PYTHON_IMAGE, and the base test policy names the sandbox user again. Running conformance against any gateway without an override is left to a follow-up. Signed-off-by: Matthew Grossman <[email protected]>
1 parent 3a31220 commit 9ab1be1

13 files changed

Lines changed: 39 additions & 25 deletions

File tree

‎TESTING.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,9 @@ Suites:
429429
`openshell-conformance` against the lane's gateway and writes a JUnit report
430430
under `results/`; set `OPENSHELL_CONFORMANCE_BIN` to use a prebuilt program,
431431
as Branch E2E does with the static build it makes once per architecture.
432-
The
432+
The Docker and Podman runners build `openshell/e2e-python:dev` for it; the
433+
Kubernetes and VM runners set `OPENSHELL_TEST_PYTHON_IMAGE` to a pullable
434+
Python image unless it is already set. The
433435
installed-artifact conformance lanes run the same crate through
434436
`openshell-test-runner` (see above).
435437
- Driver suites (`--features e2e-docker`, `e2e-podman`, `e2e-kubernetes`, or

‎e2e/rust/e2e-docker.sh‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ if [ "${1:-}" = "${RUN_WITH_GATEWAY_COMMAND}" ]; then
5454
exit 0
5555
fi
5656

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

6161
exec "${ROOT}/e2e/with-docker-gateway.sh" \
6262
bash "${BASH_SOURCE[0]}" "${RUN_WITH_GATEWAY_COMMAND}"

‎e2e/rust/e2e-kubernetes.sh‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ run_conformance() {
8080
fi
8181

8282
OPENSHELL_CONFORMANCE_JUNIT="${OPENSHELL_CONFORMANCE_JUNIT:-${ROOT}/results/${OPENSHELL_E2E_REPORT_NAME:-e2e-kubernetes}-conformance.xml}" \
83+
OPENSHELL_TEST_PYTHON_IMAGE="${OPENSHELL_TEST_PYTHON_IMAGE:-${E2E_PULLABLE_PYTHON_IMAGE}}" \
8384
e2e_run_openshell_conformance "Kubernetes"
8485
}
8586

‎e2e/rust/e2e-podman.sh‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ if [ -n "${OPENSHELL_GATEWAY_ENDPOINT:-}" ] && [ -z "${OPENSHELL_BIN:-}" ]; then
116116
export OPENSHELL_BIN="${ROOT}/target/debug/openshell"
117117
fi
118118

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

123123
exec "${ROOT}/e2e/with-podman-gateway.sh" \
124124
bash "${BASH_SOURCE[0]}" "${RUN_WITH_GATEWAY_COMMAND}"

‎e2e/rust/e2e-vm.sh‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,8 @@ e2e_export_gateway_restart_metadata \
463463
# preparation; allow 180s for slower CI runners.
464464
export OPENSHELL_PROVISION_TIMEOUT="${SANDBOX_PROVISION_TIMEOUT}"
465465

466-
e2e_run_openshell_conformance "VM"
466+
OPENSHELL_TEST_PYTHON_IMAGE="${OPENSHELL_TEST_PYTHON_IMAGE:-${E2E_PULLABLE_PYTHON_IMAGE}}" \
467+
e2e_run_openshell_conformance "VM"
467468
if [ "${E2E_FEATURES}" = "e2e-conformance-only" ]; then
468469
echo "::notice::Skipping Rust e2e tests (e2e-conformance-only)"
469470
exit 0

‎e2e/support/conformance.sh‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ e2e_require_openshell_bin() {
2323
export OPENSHELL_BIN="${binary_dir}/$(basename "${OPENSHELL_BIN}")"
2424
}
2525

26+
# A pullable image for testkit::python_image() on lanes that can't load the
27+
# locally built openshell/e2e-python:dev into their compute platform. It
28+
# matches the Rust harness's E2E_WORKLOAD_IMAGE for those lanes.
29+
# shellcheck disable=SC2034 # Used by the scripts that source this file.
30+
E2E_PULLABLE_PYTHON_IMAGE="ghcr.io/astral-sh/uv:0.12.17-python3.12-trixie-slim@sha256:9a59bb7206905ccaae4f7dab222fbac47c125a21e5fc16f43f427cd6c940ade3"
31+
2632
# Print the path of the openshell-conformance program: OPENSHELL_CONFORMANCE_BIN
2733
# if set, else a debug build from this checkout.
2834
e2e_openshell_conformance_bin() {

‎tasks/test.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ run = "OPENSHELL_TEST_CONTAINER_ENGINE=podman e2e/with-podman-gateway.sh cargo t
177177

178178
["e2e:testkit"]
179179
description = "Run the testkit suites in tests/suites/conformance against a Docker-backed gateway"
180+
depends = ["e2e:workload:build"]
180181
run = "e2e/with-docker-gateway.sh cargo nextest run --locked --manifest-path tests/suites/conformance/Cargo.toml --workspace --test-threads 1 --no-fail-fast"
181182

182183
["e2e:rust:push"]

‎tests/testkit/README.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ fails. A killed test process skips cleanup, so names are unique to the run.
7676
compute driver. Driver suites call it first.
7777
- `testkit::base_image()` for the image to create sandboxes from or build on:
7878
`OPENSHELL_TEST_BASE_IMAGE`, or OpenShell's default sandbox image.
79-
- `testkit::python_image()` for sandboxes that run `python3`:
80-
`OPENSHELL_TEST_PYTHON_IMAGE`, or a pinned public uv Python image that any
81-
gateway can pull. It has the standard library only, not curl, git, or
82-
openssl.
79+
- `testkit::python_image()` for sandboxes that run `python3`, curl, git, or
80+
openssl: `OPENSHELL_TEST_PYTHON_IMAGE`, or `openshell/e2e-python:dev`
81+
(`e2e/python/Dockerfile.workload`). The tmachine installers load it into
82+
every environment; `mise run e2e:workload:build` builds it locally.
8383
- `cx.cli([...])` to run the installed CLI against the same gateway, with
8484
`success()`, `failure()`, and `json()` on the output. `cx.cli_handle()`
8585
returns that CLI for code that can't borrow `cx`, such as a cleanup hook.

‎tests/testkit/testkit/src/base-policy.yaml‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
# The sandbox policy tests start from (testkit::policy::base()): the image's
5-
# system directories read-only, the sandbox's home and /tmp writable, and no
6-
# network access. Tests add the network access they need with
7-
# testkit::policy::allow(). It names no workload user, so the driver runs the
8-
# image's non-root user, or a default non-root user when the image has none.
5+
# system directories read-only, the sandbox's home and /tmp writable, the
6+
# sandbox user, and no network access. Tests add the network access they need
7+
# with testkit::policy::allow().
98
version: 1
109
filesystem_policy:
1110
include_workdir: true
1211
read_only: [/usr, /lib, /lib64, /proc, /dev/urandom, /app, /etc, /var/log]
1312
read_write: [/sandbox, /tmp, /dev/null]
1413
landlock:
1514
compatibility: best_effort
15+
process:
16+
run_as_user: sandbox
17+
run_as_group: sandbox

‎tests/testkit/testkit/src/image.rs‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ const DEFAULT_BASE_IMAGE: &str = "nvcr.io/nvidia/base/ubuntu:24.04";
1111

1212
/// Overrides [`DEFAULT_PYTHON_IMAGE`].
1313
const PYTHON_IMAGE_ENV: &str = "OPENSHELL_TEST_PYTHON_IMAGE";
14-
/// The image for tests that run `python3` in a sandbox. It is public and
15-
/// pinned by digest so any gateway can pull it, and has the Python standard
16-
/// library only: no curl, git or openssl.
17-
const DEFAULT_PYTHON_IMAGE: &str = "ghcr.io/astral-sh/uv:0.12.17-python3.12-trixie-slim@sha256:9a59bb7206905ccaae4f7dab222fbac47c125a21e5fc16f43f427cd6c940ade3";
14+
/// The workload image for tests that run `python3`, curl, git or openssl in a
15+
/// sandbox, built from `e2e/python/Dockerfile.workload`. It isn't published:
16+
/// the tmachine installers load it into every environment, and
17+
/// `mise run e2e:workload:build` builds it locally.
18+
const DEFAULT_PYTHON_IMAGE: &str = "openshell/e2e-python:dev";
1819

1920
/// The paths `python3` runs from in [`python_image`] images, as network
2021
/// policy binaries: the system Python, the pullable uv image's Python, and the

0 commit comments

Comments
 (0)