Skip to content

Commit 2a565b2

Browse files
authored
test(continuity): add suites for gateway restart and package upgrade (#3521)
* test(continuity): add the continuity family and gateway-restart disruption Add a `continuity` e2e family whose scenarios are `seed` and `verify` test pairs sharing state through a run-scoped id. With `--disruption <name>` the test runner seeds, applies the named disruption in the guest, waits for the gateway, and then verifies, so scenarios stay independent of the disruption. The runner keeps a registry of disruption names. How a disruption is carried out depends on how OpenShell is installed, so the installer provides it as an executable under /var/lib/openshell-qualification/disruptions, and the runner checks that it exists before it seeds anything. The packaged-gateway role renders gateway-restart for the user that runs the gateway. The e2e matrix gains a `disruption` column and a `continuity/gateway-restart` row on ubuntu-docker-rootful with the deb installer. Signed-off-by: Evan Lezar <elezar@nvidia.com> * test(continuity): add the upgrade disruption Add an `upgrade` disruption that installs a candidate Debian package over a released baseline, switches the gateway to the candidate's runtime images, restarts it, and fails if the installed package is not the candidate. The scenarios stay unchanged and run under it like any other disruption. The `deb-upgrade-source` installer provisions the guest from a released package and its release-tagged images, and stages the candidate package and images under /var/lib/openshell-qualification/candidate together with the `upgrade` disruption that installs them. The packaged-gateway role keeps the release's own image configuration for a released source. Signed-off-by: Evan Lezar <elezar@nvidia.com> * ci(continuity): run the continuity suites in CI Add an `upgrade` row to the continuity matrix that installs the candidate over the latest published release. The baseline is the release's Debian package and runtime images, staged under artifacts/upgrade by prepare-integration-inputs when a caller passes `include-deb-upgrade-source`; callers select the row with `upgrade-source`, as external drivers are. Add an optional `test:e2e:continuity` label to Branch E2E Checks that runs the continuity family on top of `test:e2e`, and run it in Release Dev and Pre-release qualification. It is not part of either release result yet, so a failure shows in the run without blocking the release. Document the label, the family and how to run it locally. Signed-off-by: Evan Lezar <elezar@nvidia.com> --------- Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent 498a0bb commit 2a565b2

26 files changed

Lines changed: 5609 additions & 16 deletions
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Prepare upgrade source
5+
description: >-
6+
Download a published release's package and runtime images under
7+
artifacts/upgrade, the baseline of the upgrade disruption. Run it in the job
8+
that uses them, so a failure to download affects only that job.
9+
10+
inputs:
11+
tag:
12+
description: Release tag to use as the baseline, such as v0.1.9
13+
required: true
14+
package:
15+
description: Package type of the baseline; only deb is supported
16+
required: false
17+
default: deb
18+
github-token:
19+
description: Token that reads the release and pulls its images from GHCR
20+
required: true
21+
22+
runs:
23+
using: composite
24+
steps:
25+
# The package doesn't embed the images; its gateway pins the release tag.
26+
# They go in as tarballs so the guest needs no registry access.
27+
- name: Download the released package
28+
shell: bash
29+
env:
30+
GH_TOKEN: ${{ inputs.github-token }}
31+
SOURCE_TAG: ${{ inputs.tag }}
32+
PACKAGE: ${{ inputs.package }}
33+
run: |
34+
set -euo pipefail
35+
if [ -z "${SOURCE_TAG}" ]; then
36+
echo "::error::no release tag to use as the upgrade baseline"
37+
exit 1
38+
fi
39+
if [ "${PACKAGE}" != "deb" ]; then
40+
echo "::error::unsupported upgrade source package type: ${PACKAGE}"
41+
exit 1
42+
fi
43+
source_dir=artifacts/upgrade/deb/source
44+
download_dir="${source_dir}/download"
45+
gh release download "$SOURCE_TAG" --repo "$GITHUB_REPOSITORY" \
46+
--pattern 'openshell_*_amd64.deb' \
47+
--pattern openshell-checksums-sha256.txt \
48+
--dir "$download_dir"
49+
deb_path=$(find "$download_dir" -maxdepth 1 -type f -name 'openshell_*_amd64.deb' -print -quit)
50+
if [[ -z "$deb_path" || ! -f "${download_dir}/openshell-checksums-sha256.txt" ]]; then
51+
echo "::error::release ${SOURCE_TAG} did not contain the expected Debian package and checksums"
52+
exit 1
53+
fi
54+
(
55+
cd "$download_dir"
56+
grep -F " $(basename "$deb_path")" openshell-checksums-sha256.txt | sha256sum --check --status
57+
)
58+
mv "$deb_path" "${source_dir}/openshell.deb"
59+
rm -rf "$download_dir"
60+
61+
- name: Export the released runtime images
62+
shell: bash
63+
env:
64+
GH_TOKEN: ${{ inputs.github-token }}
65+
SOURCE_TAG: ${{ inputs.tag }}
66+
run: |
67+
set -euo pipefail
68+
echo "${GH_TOKEN}" | docker login ghcr.io -u "${GITHUB_ACTOR}" --password-stdin
69+
image_tag="${SOURCE_TAG#v}"
70+
mkdir -p artifacts/upgrade/source-images
71+
for image in sandbox supervisor; do
72+
docker pull "ghcr.io/nvidia/openshell/${image}:${image_tag}"
73+
docker save --output "artifacts/upgrade/source-images/openshell-${image}-tmachine.tar" \
74+
"ghcr.io/nvidia/openshell/${image}:${image_tag}"
75+
done

‎.github/workflows/branch-checks.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ jobs:
294294
cargo fmt --manifest-path tests/tmachine/Cargo.toml --all -- --check
295295
cargo fmt --manifest-path tests/runner/Cargo.toml --all -- --check
296296
cargo fmt --manifest-path tests/suites/conformance/Cargo.toml --all -- --check
297+
cargo fmt --manifest-path tests/suites/continuity/Cargo.toml --all -- --check
297298
cargo fmt --manifest-path tests/suites/drivers/podman/Cargo.toml --all -- --check
298299
cargo fmt --manifest-path tests/suites/features/Cargo.toml --all -- --check
299300
cargo fmt --manifest-path tests/support/Cargo.toml --all -- --check
@@ -359,6 +360,7 @@ jobs:
359360
cargo clippy --locked --manifest-path tests/tmachine/Cargo.toml --all-targets -- -D warnings
360361
cargo clippy --locked --manifest-path tests/runner/Cargo.toml --all-targets -- -D warnings
361362
cargo clippy --locked --manifest-path tests/suites/conformance/Cargo.toml --workspace --all-targets -- -D warnings
363+
cargo clippy --locked --manifest-path tests/suites/continuity/Cargo.toml --workspace --all-targets -- -D warnings
362364
cargo clippy --locked --manifest-path tests/suites/drivers/podman/Cargo.toml --workspace --all-targets -- -D warnings
363365
cargo clippy --locked --manifest-path tests/suites/features/Cargo.toml --workspace --all-targets -- -D warnings
364366
cargo clippy --locked --manifest-path tests/support/Cargo.toml --all-targets -- -D warnings

‎.github/workflows/branch-e2e.yml‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
run_gpu_e2e: ${{ steps.labels.outputs.run_gpu_e2e }}
2727
run_kubernetes_ha_e2e: ${{ steps.labels.outputs.run_kubernetes_ha_e2e }}
2828
run_kubernetes_credential_drivers_e2e: ${{ steps.labels.outputs.run_kubernetes_credential_drivers_e2e }}
29+
run_continuity_e2e: ${{ steps.labels.outputs.run_continuity_e2e }}
2930
run_any_e2e: ${{ steps.labels.outputs.run_any_e2e }}
3031
steps:
3132
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -47,12 +48,14 @@ jobs:
4748
run_gpu_e2e="$(jq -r 'index("test:e2e-gpu") != null' <<< "$LABELS_JSON")"
4849
run_kubernetes_ha_e2e="$(jq -r 'index("test:e2e-kubernetes") != null' <<< "$LABELS_JSON")"
4950
run_kubernetes_credential_drivers_e2e="$(jq -r 'index("test:e2e-kubernetes") != null' <<< "$LABELS_JSON")"
51+
run_continuity_e2e="$(jq -r 'index("test:e2e:continuity") != null' <<< "$LABELS_JSON")"
5052
;;
5153
*)
5254
run_core_e2e=true
5355
run_gpu_e2e=true
5456
run_kubernetes_ha_e2e=false
5557
run_kubernetes_credential_drivers_e2e=false
58+
run_continuity_e2e=true
5659
;;
5760
esac
5861
if [ "$run_core_e2e" = "true" ] || [ "$run_gpu_e2e" = "true" ] || [ "$run_kubernetes_ha_e2e" = "true" ] || [ "$run_kubernetes_credential_drivers_e2e" = "true" ]; then
@@ -66,6 +69,7 @@ jobs:
6669
echo "run_gpu_e2e=$run_gpu_e2e"
6770
echo "run_kubernetes_ha_e2e=$run_kubernetes_ha_e2e"
6871
echo "run_kubernetes_credential_drivers_e2e=$run_kubernetes_credential_drivers_e2e"
72+
echo "run_continuity_e2e=$run_continuity_e2e"
6973
echo "run_any_e2e=$run_any_e2e"
7074
} >> "$GITHUB_OUTPUT"
7175
@@ -463,6 +467,26 @@ jobs:
463467
secrets:
464468
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
465469

470+
# Run the continuity suites (tests/suites/continuity) on tmachine: state
471+
# seeded before a disruption, such as a gateway restart or an upgrade from the
472+
# latest release, must survive it. The label adds to test:e2e, whose builds it
473+
# reuses.
474+
continuity-integration:
475+
needs: [pr_metadata, prepare-integration]
476+
if: needs.pr_metadata.outputs.run_integration == 'true' && needs.pr_metadata.outputs.run_continuity_e2e == 'true'
477+
permissions:
478+
actions: read
479+
contents: read
480+
packages: read
481+
uses: ./.github/workflows/e2e-suites.yml
482+
with:
483+
family: continuity
484+
upgrade-source: true
485+
source-sha: ${{ needs.prepare-integration.outputs.source_sha }}
486+
integration-inputs-artifact-id: ${{ needs.prepare-integration.outputs.integration_inputs_artifact_id }}
487+
secrets:
488+
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
489+
466490
# Run the Podman e2e suite on tmachine against the packaged gateway.
467491
podman-e2e-integration:
468492
needs: prepare-integration

‎.github/workflows/e2e-label-help.yml‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ permissions: {}
1919
jobs:
2020
hint:
2121
name: Post next-step hint for E2E label
22-
if: github.event.label.name == 'test:e2e' || github.event.label.name == 'test:e2e-gpu' || github.event.label.name == 'test:e2e-kubernetes'
22+
if: github.event.label.name == 'test:e2e' || github.event.label.name == 'test:e2e-gpu' || github.event.label.name == 'test:e2e-kubernetes' || github.event.label.name == 'test:e2e:continuity'
2323
runs-on: ubuntu-latest
2424
permissions:
2525
pull-requests: write
@@ -55,6 +55,11 @@ jobs:
5555
build_summary="gateway, sandbox, and supervisor images"
5656
status_summary="This is an optional proof-of-life suite; failures are visible in the workflow run but do not publish a required CI gate status."
5757
;;
58+
test:e2e:continuity)
59+
suite_summary="the continuity suites (gateway restart and upgrade from the latest release); apply test:e2e as well, since it builds what they run on"
60+
build_summary="gateway, sandbox, and supervisor images and packages"
61+
status_summary="This is an optional suite; failures are visible in the workflow run but do not publish a required CI gate status."
62+
;;
5863
*) echo "Unrecognized label $LABEL_NAME"; exit 1 ;;
5964
esac
6065

‎.github/workflows/e2e-suites.yml‎

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ on:
4141
required: false
4242
type: boolean
4343
default: false
44+
upgrade-source:
45+
description: Also run the rows that upgrade from a released package; each downloads the latest release as its baseline
46+
required: false
47+
type: boolean
48+
default: false
4449
prebuilt:
4550
description: Run the rows with this run's prebuilt tests instead of building them in every job; conformance rows take the openshell-conformance-x86_64-unknown-linux-musl artifact, other rows their family's openshell-e2e-bundle-<family>-x86_64-unknown-linux-musl artifact
4651
required: false
@@ -71,12 +76,14 @@ jobs:
7176
timeout-minutes: 5
7277
outputs:
7378
matrix: ${{ steps.rows.outputs.matrix }}
79+
upgrade_source_tag: ${{ steps.baseline.outputs.tag }}
7480
steps:
7581
- name: Select the rows to run
7682
id: rows
7783
env:
7884
FAMILY: ${{ inputs.family }}
7985
EXTERNAL_DRIVERS: ${{ inputs.external-drivers }}
86+
UPGRADE_SOURCE: ${{ inputs.upgrade-source }}
8087
run: |
8188
set -euo pipefail
8289
# Only amd64 for now: CI has no arm64 runner with KVM for tmachine,
@@ -114,14 +121,18 @@ jobs:
114121
{"environment":"fedora-podman-rootless-userns-default","installer":"rpm","family":"drivers/podman","gateway":"openshell","runner":"ubuntu-24.04"},
115122
{"environment":"fedora-podman-rootless-userns-auto","installer":"rpm","family":"drivers/podman","gateway":"openshell","runner":"ubuntu-24.04"},
116123
{"environment":"fedora-podman-rootless-userns-keep-id","installer":"rpm","family":"drivers/podman","gateway":"openshell","runner":"ubuntu-24.04"},
117-
{"environment":"fedora-podman-rootless-userns-private","installer":"rpm","family":"drivers/podman","gateway":"openshell","runner":"ubuntu-24.04"}
124+
{"environment":"fedora-podman-rootless-userns-private","installer":"rpm","family":"drivers/podman","gateway":"openshell","runner":"ubuntu-24.04"},
125+
{"environment":"ubuntu-docker-rootful","installer":"deb","family":"continuity","disruption":"gateway-restart","gateway":"openshell","runner":"ubuntu-24.04"},
126+
{"environment":"ubuntu-docker-rootful","installer":"deb-upgrade-source","family":"continuity","disruption":"upgrade","gateway":"openshell","runner":"ubuntu-24.04","upgrade_source":true,"upgrade_package":"deb"}
118127
]'
119128
# `suite` names the row's tests in the job and artifact names.
120-
matrix=$(jq -c --arg family "${FAMILY}" --arg external "${EXTERNAL_DRIVERS}" '{include: map(
129+
matrix=$(jq -c --arg family "${FAMILY}" --arg external "${EXTERNAL_DRIVERS}" --arg upgrade "${UPGRADE_SOURCE}" '{include: map(
121130
select($family == "" or .family == $family or (.family | startswith($family + "/")))
122131
| select((.external_driver // false) == false or $external == "true")
132+
| select((.upgrade_source // false) == false or $upgrade == "true")
123133
| .package //= ""
124-
| .suite = (if .package == "" then .family else "\(.family)/\(.package)" end)
134+
| .disruption //= ""
135+
| .suite = ([.family, .package, .disruption] | map(select(. != "")) | join("/"))
125136
| .artifact = ([.suite, .environment, .installer] | join("-") | gsub("/"; "-"))
126137
| .bundle = "openshell-e2e-bundle-\(.family | gsub("/"; "-"))-x86_64-unknown-linux-musl"
127138
)}' <<< "$rows")
@@ -132,6 +143,18 @@ jobs:
132143
echo "$matrix"
133144
echo "matrix=${matrix}" >> "$GITHUB_OUTPUT"
134145
146+
# Resolve the latest release once, so every upgrade row tests against the
147+
# same baseline. A failure leaves the tag empty and fails only the upgrade
148+
# rows, instead of every row.
149+
- name: Resolve the upgrade baseline
150+
id: baseline
151+
if: inputs.upgrade-source
152+
env:
153+
GH_TOKEN: ${{ github.token }}
154+
run: |
155+
tag=$(gh release view --repo "$GITHUB_REPOSITORY" --json tagName --jq .tagName || true)
156+
echo "tag=${tag}" >> "$GITHUB_OUTPUT"
157+
135158
suites:
136159
name: E2E suites (${{ matrix.suite }}, ${{ matrix.environment }}, ${{ matrix.installer }})
137160
needs: select
@@ -193,6 +216,16 @@ jobs:
193216
artifact-ids: ${{ inputs['integration-inputs-artifact-id'] }}
194217
path: artifacts
195218

219+
# The baseline of an upgrade row. It is prepared here, not in the shared
220+
# input preparation, so a failure to fetch it affects only this row.
221+
- name: Prepare the upgrade baseline
222+
if: matrix.upgrade_source
223+
uses: ./.github/actions/prepare-upgrade-source
224+
with:
225+
tag: ${{ needs.select.outputs.upgrade_source_tag }}
226+
package: ${{ matrix.upgrade_package }}
227+
github-token: ${{ github.token }}
228+
196229
# The program and the bundles are built once per run (see
197230
# build-conformance and build-e2e-bundles in branch-e2e.yml), so the rows
198231
# need not each build the suites.
@@ -218,6 +251,7 @@ jobs:
218251
FAMILY: ${{ matrix.family }}
219252
PACKAGE: ${{ matrix.package }}
220253
GATEWAY: ${{ matrix.gateway }}
254+
DISRUPTION: ${{ matrix.disruption }}
221255
run: |
222256
# The tests this environment can't pass yet; the runner passes the
223257
# variable on to the guest.
@@ -244,6 +278,10 @@ jobs:
244278
selection+=(--package "${PACKAGE}")
245279
fi
246280
fi
281+
# A continuity row seeds state, applies the disruption, and verifies.
282+
if [ -n "${DISRUPTION}" ]; then
283+
selection+=(--disruption "${DISRUPTION}")
284+
fi
247285
nix run .#openshell-test-runner -- run \
248286
--environment "${ENVIRONMENT}" \
249287
--installer "${INSTALLER}" \

‎.github/workflows/release-dev.yml‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,22 @@ jobs:
155155
secrets:
156156
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
157157

158+
continuity-integration:
159+
needs: prepare-integration
160+
permissions:
161+
actions: read
162+
contents: read
163+
packages: read
164+
uses: ./.github/workflows/e2e-suites.yml
165+
with:
166+
family: continuity
167+
upgrade-source: true
168+
cancel-in-progress: false
169+
source-sha: ${{ needs.prepare-integration.outputs.source_sha }}
170+
integration-inputs-artifact-id: ${{ needs.prepare-integration.outputs.integration_inputs_artifact_id }}
171+
secrets:
172+
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
173+
158174
feature-specific-integration:
159175
needs: prepare-integration
160176
permissions:
@@ -262,6 +278,7 @@ jobs:
262278
- compute-versions
263279
- package-binaries
264280
- conformance-integration
281+
- continuity-integration
265282
- feature-specific-integration
266283
- docker-e2e
267284
- vm-e2e

‎.github/workflows/release-qualification.yml‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,21 @@ jobs:
9393
secrets:
9494
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
9595

96+
continuity-integration:
97+
needs: prepare-integration
98+
permissions:
99+
actions: read
100+
contents: read
101+
packages: read
102+
uses: ./.github/workflows/e2e-suites.yml
103+
with:
104+
family: continuity
105+
upgrade-source: true
106+
source-sha: ${{ needs.prepare-integration.outputs.source_sha }}
107+
integration-inputs-artifact-id: ${{ needs.prepare-integration.outputs.integration_inputs_artifact_id }}
108+
secrets:
109+
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
110+
96111
feature-specific-integration:
97112
needs: prepare-integration
98113
permissions:
@@ -161,6 +176,7 @@ jobs:
161176
- protobuf-compatibility
162177
- security
163178
- conformance-integration
179+
- continuity-integration
164180
- feature-specific-integration
165181
- docker-e2e
166182
- vm-e2e
@@ -179,6 +195,7 @@ jobs:
179195
id: summary
180196
env:
181197
CONFORMANCE_RESULT: ${{ needs.conformance-integration.result }}
198+
CONTINUITY_RESULT: ${{ needs.continuity-integration.result }}
182199
DOCKER_E2E_RESULT: ${{ needs.docker-e2e.result }}
183200
FEATURE_INTEGRATION_RESULT: ${{ needs.feature-specific-integration.result }}
184201
IS_PRERELEASE: ${{ inputs.is-prerelease }}
@@ -210,6 +227,7 @@ jobs:
210227
echo "| Protobuf API compatibility | ${PROTO_COMPATIBILITY_RESULT} |"
211228
echo "| Security | ${SECURITY_RESULT} |"
212229
echo "| Conformance integration | ${CONFORMANCE_RESULT} |"
230+
echo "| Continuity integration | ${CONTINUITY_RESULT} |"
213231
echo "| Feature integration | ${FEATURE_INTEGRATION_RESULT} |"
214232
echo "| Docker E2E | ${DOCKER_E2E_RESULT} |"
215233
echo "| VM E2E | ${VM_E2E_RESULT} |"

0 commit comments

Comments
 (0)