Skip to content
Open
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
8 changes: 6 additions & 2 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,10 @@ nix run .#openshell-test-runner -- run \
--family continuity --disruption gateway-restart
```

tmachine doesn't run the VM driver yet (#5918), so `mise run e2e:vm` runs the
`seed` tests, restarts its gateway, and runs the `verify` tests itself. It sets
`OPENSHELL_TEST_VM_STATE_DIR` for checks on the VM driver's state.

The `upgrade` disruption installs the candidate over a released package. Use the
`deb-upgrade-source` installer, or `rpm-upgrade-source` on `fedora-podman-rootless` or
`fedora-podman-rootful`, which installs the latest release as the baseline.
Expand Down Expand Up @@ -563,7 +567,7 @@ Suites:
- Driver suites (`--features e2e-docker`, `e2e-podman`, `e2e-kubernetes`, or
`e2e-vm`) - conformance plus the common and driver-specific coverage for
the selected deployment.
- Docker suite (`--features e2e-docker`) - includes Docker-only coverage such as Dockerfile image builds, Docker preflight checks, and managed Docker gateway start.
- Docker suite (`--features e2e-docker`) - includes Docker-only coverage such as Dockerfile image builds and Docker preflight checks.
- Docker GPU suite (`--features e2e-docker-gpu`) - Docker suite plus GPU sandbox smoke coverage.
- VM suite (`--features e2e-vm`) - runs e2e tests on a VM.
- Kubernetes credential-driver suite (`--features e2e-kubernetes-credential-drivers`) - targeted Kubernetes Secrets and Vault provider credential storage coverage.
Expand Down Expand Up @@ -1010,7 +1014,7 @@ cargo test --manifest-path e2e/rust/Cargo.toml --features e2e --test sync
Run a single Docker-only test directly with cargo:

```shell
cargo test --manifest-path e2e/rust/Cargo.toml --features e2e-docker --test gateway_start
cargo test --manifest-path e2e/rust/Cargo.toml --features e2e-docker --test provider_readiness
```

The harness (`e2e/rust/src/harness/`) provides:
Expand Down
20 changes: 0 additions & 20 deletions e2e/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,26 +81,11 @@ name = "additional_ca"
path = "tests/additional_ca.rs"
required-features = ["e2e-additional-ca"]

[[test]]
name = "gateway_start"
path = "tests/gateway_start.rs"
required-features = ["e2e-docker"]

[[test]]
name = "local_driver_token_restart"
path = "tests/local_driver_token_restart.rs"
required-features = ["e2e"]

[[test]]
name = "ephemeral_cleanup"
path = "tests/ephemeral_cleanup.rs"
required-features = ["e2e"]

[[test]]
name = "podman_gateway_start"
path = "tests/podman_gateway_start.rs"
required-features = ["e2e-podman"]

[[test]]
name = "provider_refresh_handles"
path = "tests/provider_refresh_handles.rs"
Expand All @@ -116,11 +101,6 @@ name = "provider_readiness"
path = "tests/provider_readiness.rs"
required-features = ["e2e-docker"]

[[test]]
name = "vm_gateway_start"
path = "tests/vm_gateway_start.rs"
required-features = ["e2e-vm"]

[[test]]
name = "vm_corporate_proxy"
path = "tests/vm_corporate_proxy.rs"
Expand Down
1 change: 0 additions & 1 deletion e2e/rust/e2e-podman.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ source "${ROOT}/e2e/support/conformance.sh"
PODMAN_CI_TESTS=(
ephemeral_cleanup
edge_tunnel_e2e
podman_gateway_start
provider_github_app
)

Expand Down
65 changes: 41 additions & 24 deletions e2e/rust/e2e-vm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
source "${ROOT}/e2e/support/gateway-common.sh"
# shellcheck source=e2e/support/conformance.sh
source "${ROOT}/e2e/support/conformance.sh"
# shellcheck source=e2e/support/continuity.sh
source "${ROOT}/e2e/support/continuity.sh"

COMPRESSED_DIR="${ROOT}/target/vm-runtime-compressed"
GATEWAY_BIN="${OPENSHELL_GATEWAY_BIN:-${ROOT}/target/debug/openshell-gateway}"
Expand Down Expand Up @@ -371,10 +373,13 @@ GATEWAY_ARGS=(
)
e2e_write_gateway_args_file "${GATEWAY_ARGS_FILE}" "${GATEWAY_ARGS[@]}"

"${GATEWAY_BIN}" "${GATEWAY_ARGS[@]}" \
>"${GATEWAY_LOG}" 2>&1 &
GATEWAY_PID=$!
printf '%s\n' "${GATEWAY_PID}" >"${GATEWAY_PID_FILE}"
start_gateway() {
"${GATEWAY_BIN}" "${GATEWAY_ARGS[@]}" \
>>"${GATEWAY_LOG}" 2>&1 &
GATEWAY_PID=$!
printf '%s\n' "${GATEWAY_PID}" >"${GATEWAY_PID_FILE}"
}
start_gateway

# Register the gateway before polling so readiness exercises the same mTLS
# client path as the smoke tests.
Expand All @@ -393,25 +398,25 @@ export OPENSHELL_GATEWAY_ENDPOINT="${CLI_GATEWAY_ENDPOINT}"
# particular gateway log message. The VM driver is spawned eagerly, while
# sandboxes are created on demand.

echo "==> Waiting for gateway readiness (timeout ${GATEWAY_READY_TIMEOUT}s)"
elapsed=0
last_status_output=""
while [ "${elapsed}" -lt "${GATEWAY_READY_TIMEOUT}" ]; do
if ! kill -0 "${GATEWAY_PID}" 2>/dev/null; then
echo "ERROR: openshell-gateway exited before becoming ready"
exit 1
fi
if last_status_output="$("${CLI_BIN}" status --output json 2>&1)" &&
printf '%s\n' "${last_status_output}" |
grep -Eq '"status"[[:space:]]*:[[:space:]]*"connected"'; then
echo "==> Gateway ready after ${elapsed}s"
break
fi
sleep 2
elapsed=$((elapsed + 2))
done
wait_for_gateway() {
echo "==> Waiting for gateway readiness (timeout ${GATEWAY_READY_TIMEOUT}s)"
local elapsed=0
local last_status_output=""
while [ "${elapsed}" -lt "${GATEWAY_READY_TIMEOUT}" ]; do
if ! kill -0 "${GATEWAY_PID}" 2>/dev/null; then
echo "ERROR: openshell-gateway exited before becoming ready"
exit 1
fi
if last_status_output="$("${CLI_BIN}" status --output json 2>&1)" &&
printf '%s\n' "${last_status_output}" |
grep -Eq '"status"[[:space:]]*:[[:space:]]*"connected"'; then
echo "==> Gateway ready after ${elapsed}s"
return
fi
sleep 2
elapsed=$((elapsed + 2))
done

if [ "${elapsed}" -ge "${GATEWAY_READY_TIMEOUT}" ]; then
echo "ERROR: openshell-gateway did not become ready after ${GATEWAY_READY_TIMEOUT}s"
echo "=== last openshell status output ==="
if [ -n "${last_status_output}" ]; then
Expand All @@ -421,7 +426,8 @@ if [ "${elapsed}" -ge "${GATEWAY_READY_TIMEOUT}" ]; then
fi
echo "=== end openshell status output ==="
exit 1
fi
}
wait_for_gateway

# ── Run the smoke test ───────────────────────────────────────────────
#
Expand Down Expand Up @@ -496,6 +502,17 @@ else
run_e2e_test ephemeral_cleanup
run_e2e_test vm_overlay
run_e2e_test vm_bind_mount
run_e2e_test vm_gateway_start
run_e2e_test vm_corporate_proxy

# The continuity suite's seed and verify tests, with a gateway restart
# between them, as tmachine's gateway-restart disruption does (#5918).
CONTINUITY_RUN_ID="$(printf '%x' "$(date +%s)")"
export CONTINUITY_RUN_ID
export OPENSHELL_TEST_VM_STATE_DIR="${RUN_STATE_DIR}"
e2e_run_continuity_phase seed
echo "==> Restarting openshell-gateway"
e2e_stop_gateway "${GATEWAY_PID}" "${GATEWAY_PID_FILE}"
start_gateway
wait_for_gateway
e2e_run_continuity_phase verify
fi
Loading
Loading