Skip to content

Commit 221cf8a

Browse files
committed
fix(tmachine): restore package-installed Podman qualification
Signed-off-by: Evan Lezar <[email protected]>
1 parent 834b79a commit 221cf8a

13 files changed

Lines changed: 261 additions & 83 deletions

File tree

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ jobs:
279279
]
280280
281281
# Run driver-specific integration tests:
282-
# These suites require the binary installer's CLI path, local HTTP gateway,
283-
# and system service configuration for their Podman user-namespace fixtures.
282+
# Exercise the packaged gateway service and credentials. Namespace fixtures
283+
# use the installer-published service owner and active XDG configuration.
284284
driver-specific-integration:
285285
needs: prepare-integration
286286
permissions:
@@ -294,9 +294,9 @@ jobs:
294294
integration-inputs-artifact-id: ${{ needs.prepare-integration.outputs.integration_inputs_artifact_id }}
295295
test-matrix: >-
296296
[
297-
{"environment":"fedora-podman-rootful","installer":"binaries","testsuite":"driver-podman"},
298-
{"environment":"fedora-podman-rootless","installer":"binaries","testsuite":"e2e-podman"},
299-
{"environment":"fedora-podman-rootless","installer":"binaries","testsuite":"driver-podman"}
297+
{"environment":"fedora-podman-rootful","installer":"rpm","testsuite":"driver-podman"},
298+
{"environment":"fedora-podman-rootless","installer":"rpm","testsuite":"e2e-podman"},
299+
{"environment":"fedora-podman-rootless","installer":"rpm","testsuite":"driver-podman"}
300300
]
301301
302302
docker-e2e:

‎CI.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,10 @@ selected. DEB and RPM packages build only when integration qualification is sele
7777
the DEB on Ubuntu with Docker and installs the CLI and gateway RPMs on Fedora with
7878
rootful and rootless Podman. These lanes run conformance using the matching runtime
7979
images. Release Dev and Release Tag use the same package installers.
80-
Fedora provider-refresh tests also use RPMs. The Podman driver-specific suites
81-
retain the binary installer because their fixtures configure its system service,
82-
local HTTP gateway, and CLI path. The manual Integration Tests workflow defaults
80+
Fedora provider-refresh tests also use RPMs. The Podman driver-specific branch
81+
lanes use RPMs for rootful and rootless user-namespace comparisons and rootless
82+
Podman E2E. Their fixtures use the installed gateway's registration, active
83+
configuration, and service context. The manual Integration Tests workflow defaults
8384
to the package installers and downloads the packages selected by its matrix.
8485

8586
Three opt-in labels enable the long-running E2E suites:

‎TESTING.md‎

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,14 +286,48 @@ Rust tests that still apply. Run the Podman-backed Rust CLI e2e suite:
286286
mise run e2e:podman
287287
```
288288

289-
Run the portable subset in a disposable rootless Podman guest:
289+
Run the portable subset in a disposable rootless Podman guest. Stage matching
290+
candidate CLI and gateway RPMs at `artifacts/packages/rpm/openshell.rpm` and
291+
`artifacts/packages/rpm/openshell-gateway.rpm`; `build-artifacts` builds the
292+
binary, runtime-image, and test inputs but does not build these packages:
290293

291294
```shell
292295
nix run .#build-artifacts
293-
nix run .#tmachine -- test fedora-podman-rootless binaries e2e-podman
294-
nix run .#tmachine -- test fedora-podman-rootless binaries driver-podman
296+
nix run .#tmachine -- test fedora-podman-rootless rpm e2e-podman
297+
nix run .#tmachine -- test fedora-podman-rootless rpm driver-podman
295298
```
296299

300+
The driver suites also support the `binaries` installer. The shared installer
301+
roles save the active gateway configuration, registration name, service scope,
302+
service owner, and network name in `/var/lib/openshell-test/gateway.yaml`.
303+
Suites resolve `openshell` from PATH and use that registration, including the
304+
packaged gateway's HTTPS client credentials. Namespace fixtures modify the
305+
installed TOML and restart its system or user service. Package metadata points
306+
to the service owner's XDG `gateway.toml`, which can be absent when the service
307+
uses defaults and `gateway.env`. The default namespace comparison preserves
308+
that state; configured profiles create a minimal versioned TOML override only
309+
if the package has not seeded one.
310+
311+
Failure diagnostics select the matching journal unit and user ID. Missing
312+
metadata or credentials fail the run; suites do not replace package setup with
313+
an HTTP gateway.
314+
315+
Before merging harness changes, run all three driver-specific combinations
316+
locally: rootful RPM `driver-podman`, rootless RPM `driver-podman`, and rootless
317+
RPM `e2e-podman`. Use matching candidate packages, runtime images, and test
318+
archives. Add `test:e2e` to the PR and check that its branch integration jobs ran
319+
and passed; a successful workflow with skipped jobs does not validate these
320+
changes.
321+
322+
Ansible sources participate in tmachine's installation cache
323+
hash, so older cached installations are rebuilt with this metadata.
324+
325+
The `driver-podman` suite supports rootful and rootless Podman. The
326+
`e2e-podman` archive requires rootless Podman for its host workload fixtures.
327+
DEB and RPM installers share the gateway role; available environments pair
328+
DEB with Ubuntu/Docker and RPM with Fedora/Podman. A DEB/Podman run requires an
329+
Ubuntu Podman environment.
330+
297331
Print the exact tmachine archive selection as a shell `PODMAN_CI_TESTS` array:
298332

299333
```shell

‎tests/ansible/playbooks/drivers/podman/default-userns-baseline.yaml‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
- name: Wait for SSH
1313
ansible.builtin.wait_for_connection:
1414

15+
- name: Resolve installed gateway context
16+
ansible.builtin.include_role:
17+
name: openshell_test_gateway
18+
1519
- name: Detect tmachine container runtime
1620
ansible.builtin.include_role:
1721
name: tmachine_container_runtime
@@ -38,14 +42,15 @@
3842
- name: Read OpenShell gateway configuration
3943
become: true
4044
ansible.builtin.slurp:
41-
src: /etc/openshell/gateway.toml
45+
src: "{{ openshell_test_gateway.config_path }}"
4246
register: openshell_gateway_config
47+
when: openshell_test_gateway_config.stat.exists
4348

4449
- name: Require unconfigured Podman user namespaces
4550
ansible.builtin.assert:
4651
that:
4752
- >-
48-
(openshell_gateway_config.content | b64decode)
53+
(openshell_gateway_config.content | default('') | b64decode)
4954
is not regex('(?m)^\\s*(userns|uidmap|gidmap)\\s*=')
5055
fail_msg: >-
5156
The Podman default-userns suite requires gateway.toml to omit userns,

‎tests/ansible/playbooks/drivers/podman/e2e.yaml‎

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,21 @@
1111
- name: Wait for SSH
1212
ansible.builtin.wait_for_connection:
1313

14+
- name: Resolve installed gateway context
15+
ansible.builtin.include_role:
16+
name: openshell_test_gateway
17+
18+
- name: Detect tmachine container runtime
19+
ansible.builtin.include_role:
20+
name: tmachine_container_runtime
21+
22+
- name: Require rootless Podman for the E2E workload fixtures
23+
ansible.builtin.assert:
24+
that:
25+
- tmachine_container_runtime_name == 'podman'
26+
- tmachine_container_runtime_is_rootless
27+
fail_msg: The Podman E2E archive requires the rootless Podman environment
28+
1429
- name: Create Podman E2E test directory
1530
become: true
1631
ansible.builtin.file:
@@ -46,17 +61,7 @@
4661
- "{{ podman_e2e_test_root }}/openshell-e2e-python-dev.tar"
4762
environment:
4863
HOME: /home/tmachine
49-
XDG_RUNTIME_DIR: /run/user/1000
50-
51-
- name: Remove any previous OpenShell gateway registration
52-
ansible.builtin.command:
53-
argv: [/usr/local/bin/openshell, gateway, remove, tmachine]
54-
changed_when: false
55-
failed_when: false
56-
57-
- name: Register the configured OpenShell gateway
58-
ansible.builtin.command:
59-
argv: [/usr/local/bin/openshell, gateway, add, http://127.0.0.1:17670, --local, --name, tmachine]
64+
XDG_RUNTIME_DIR: "/run/user/{{ tmachine_container_runtime_tmachine_uid.stdout }}"
6065

6166
- name: Run Podman E2E archive tests
6267
ansible.builtin.command:
@@ -73,16 +78,16 @@
7378
- --no-fail-fast
7479
environment:
7580
CONTAINER_ENGINE: podman
76-
CONTAINER_HOST: unix:///run/user/1000/podman/podman.sock
81+
CONTAINER_HOST: "unix://{{ tmachine_container_runtime_socket }}"
7782
HOME: /home/tmachine
78-
OPENSHELL_BIN: /usr/local/bin/openshell
83+
OPENSHELL_BIN: "{{ openshell_test_cli.stdout }}"
7984
OPENSHELL_E2E_CONTAINER_ENGINE_UNSET_XDG_CONFIG_HOME: "1"
8085
OPENSHELL_E2E_DRIVER: podman
81-
OPENSHELL_E2E_NETWORK_NAME: tmachine
86+
OPENSHELL_E2E_NETWORK_NAME: "{{ openshell_test_gateway.network_name }}"
8287
OPENSHELL_E2E_SANDBOX_NAMESPACE: tmachine
83-
OPENSHELL_GATEWAY: tmachine
84-
OPENSHELL_PODMAN_SOCKET: /run/user/1000/podman/podman.sock
85-
XDG_RUNTIME_DIR: /run/user/1000
88+
OPENSHELL_GATEWAY: "{{ openshell_test_gateway.name }}"
89+
OPENSHELL_PODMAN_SOCKET: "{{ tmachine_container_runtime_socket }}"
90+
XDG_RUNTIME_DIR: "/run/user/{{ tmachine_container_runtime_tmachine_uid.stdout }}"
8691
register: podman_e2e_test_result
8792
changed_when: false
8893
failed_when: false
@@ -95,18 +100,10 @@
95100
ansible.builtin.debug:
96101
var: podman_e2e_test_result.stdout_lines
97102

98-
- name: Capture OpenShell gateway journal after Podman E2E test failure
99-
become: true
100-
ansible.builtin.command:
101-
argv: [journalctl, --unit, openshell-gateway.service, --no-pager, --lines, "200"]
102-
changed_when: false
103-
failed_when: false
104-
when: podman_e2e_test_result.rc != 0
105-
register: podman_e2e_gateway_journal
106-
107-
- name: Show OpenShell gateway journal after Podman E2E test failure
108-
ansible.builtin.debug:
109-
var: podman_e2e_gateway_journal.stdout_lines
103+
- name: Collect installed gateway diagnostics after test failure
104+
ansible.builtin.include_role:
105+
name: openshell_test_gateway
106+
tasks_from: journal.yaml
110107
when: podman_e2e_test_result.rc != 0
111108

112109
- name: Require Podman E2E archive success

‎tests/ansible/playbooks/drivers/podman/tests.yaml‎

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
- name: Wait for SSH
1313
ansible.builtin.wait_for_connection:
1414

15+
- name: Resolve installed gateway context
16+
ansible.builtin.include_role:
17+
name: openshell_test_gateway
18+
1519
- name: Detect tmachine container runtime
1620
ansible.builtin.include_role:
1721
name: tmachine_container_runtime
@@ -39,21 +43,12 @@
3943
owner: tmachine
4044
group: tmachine
4145

42-
- name: Remove any previous OpenShell gateway registration
43-
ansible.builtin.command:
44-
argv: [/usr/local/bin/openshell, gateway, remove, tmachine]
45-
changed_when: false
46-
failed_when: false
47-
48-
- name: Register the configured OpenShell gateway
49-
ansible.builtin.command:
50-
argv: [/usr/local/bin/openshell, gateway, add, http://127.0.0.1:17670, --local, --name, tmachine]
51-
5246
- name: Run Podman archive tests
5347
ansible.builtin.command:
5448
argv: [cargo-nextest, nextest, run, --archive-file, "{{ podman_test_root }}/tests.tar.zst", --workspace-remap, "{{ podman_test_root }}", --no-capture]
5549
environment:
56-
OPENSHELL_BIN: /usr/local/bin/openshell
50+
OPENSHELL_GATEWAY: "{{ openshell_test_gateway.name }}"
51+
OPENSHELL_BIN: "{{ openshell_test_cli.stdout }}"
5752
OPENSHELL_TEST_INPUT_DIR: "{{ podman_test_input_dir }}"
5853
OPENSHELL_PODMAN_TEST_IMAGE: "{{ openshell_podman_test_image | default('') }}"
5954
register: podman_test_result
@@ -68,24 +63,10 @@
6863
ansible.builtin.debug:
6964
var: podman_test_result.stdout_lines
7065

71-
- name: Capture OpenShell gateway journal after Podman test failure
72-
become: true
73-
ansible.builtin.command:
74-
argv:
75-
- journalctl
76-
- --unit
77-
- openshell-gateway.service
78-
- --no-pager
79-
- --lines
80-
- "200"
81-
changed_when: false
82-
failed_when: false
83-
when: podman_test_result.rc != 0
84-
register: podman_gateway_journal
85-
86-
- name: Show OpenShell gateway journal after Podman test failure
87-
ansible.builtin.debug:
88-
var: podman_gateway_journal.stdout_lines
66+
- name: Collect installed gateway diagnostics after test failure
67+
ansible.builtin.include_role:
68+
name: openshell_test_gateway
69+
tasks_from: journal.yaml
8970
when: podman_test_result.rc != 0
9071

9172
- name: Discover Podman containers after test failure

‎tests/ansible/playbooks/drivers/podman/userns-profile.yaml‎

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
- name: Wait for SSH
1313
ansible.builtin.wait_for_connection:
1414

15+
- name: Resolve installed gateway context
16+
ansible.builtin.include_role:
17+
name: openshell_test_gateway
18+
1519
- name: Detect tmachine container runtime
1620
ansible.builtin.include_role:
1721
name: tmachine_container_runtime
@@ -35,24 +39,35 @@
3539
podman_reference_home: "{{ '/home/tmachine' if tmachine_container_runtime_is_rootless else '/root' }}"
3640
podman_reference_uid: "{{ tmachine_container_runtime_tmachine_uid.stdout if tmachine_container_runtime_is_rootless else '0' }}"
3741

42+
# Keep the default profile on the installed configuration. Create an XDG
43+
# override only for packages that have not seeded a TOML file themselves.
44+
- name: Create optional gateway configuration for namespace overrides
45+
become: true
46+
ansible.builtin.copy:
47+
dest: "{{ openshell_test_gateway.config_path }}"
48+
owner: "{{ openshell_test_gateway.service_user }}"
49+
group: "{{ openshell_test_gateway.service_user }}"
50+
mode: "0600"
51+
force: false
52+
content: |
53+
[openshell]
54+
version = 2
55+
56+
[openshell.drivers.podman]
57+
when: not openshell_test_gateway_config.stat.exists
58+
3859
- name: Apply the Podman user-namespace fixture
3960
become: true
4061
ansible.builtin.blockinfile:
41-
path: /etc/openshell/gateway.toml
62+
path: "{{ openshell_test_gateway.config_path }}"
63+
insertafter: '^\[openshell\.drivers\.podman\]$'
4264
marker: "# {mark} OpenShell Podman userns test fixture"
4365
block: "{{ lookup('ansible.builtin.file', podman_userns_config) | trim }}"
4466

45-
- name: Restart OpenShell gateway with the Podman user-namespace fixture
46-
become: true
47-
ansible.builtin.systemd_service:
48-
name: openshell-gateway.service
49-
state: restarted
50-
51-
- name: Wait for the configured OpenShell gateway
52-
ansible.builtin.wait_for:
53-
host: 127.0.0.1
54-
port: 17670
55-
timeout: 60
67+
- name: Restart installed gateway with the Podman user-namespace fixture
68+
ansible.builtin.include_role:
69+
name: openshell_test_gateway
70+
tasks_from: restart.yaml
5671

5772
- name: Capture direct Podman user-namespace mapping
5873
become: true

‎tests/ansible/roles/openshell_client/tasks/main.yaml‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,18 @@
1212
- --local
1313
- --name
1414
- "{{ openshell_client_gateway_name | default('tmachine') }}"
15+
16+
- name: Publish test gateway context
17+
ansible.builtin.include_role:
18+
name: openshell_test_gateway
19+
tasks_from: publish.yaml
20+
vars:
21+
openshell_test_gateway_context:
22+
name: "{{ openshell_client_gateway_name | default('tmachine') }}"
23+
config_path: "{{ openshell_client_gateway_config_path | default('/etc/openshell/gateway.toml') }}"
24+
config_required: "{{ openshell_client_gateway_config_required | default(true) }}"
25+
service_scope: "{{ openshell_client_gateway_service_scope | default('system') }}"
26+
service_user: "{{ openshell_gateway_user if openshell_client_gateway_service_scope | default('system') == 'user' else 'root' }}"
27+
service_home: "{{ openshell_gateway_home if openshell_client_gateway_service_scope | default('system') == 'user' else '/root' }}"
28+
service_uid: "{{ openshell_gateway_uid if openshell_client_gateway_service_scope | default('system') == 'user' else '0' }}"
29+
network_name: "{{ openshell_client_gateway_network_name | default('tmachine') }}"

‎tests/ansible/roles/openshell_packaged_gateway/tasks/main.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,7 @@
106106
vars:
107107
openshell_client_gateway_endpoint: https://127.0.0.1:17670
108108
openshell_client_gateway_name: openshell
109+
openshell_client_gateway_config_path: "{{ openshell_gateway_home }}/.config/openshell/gateway.toml"
110+
openshell_client_gateway_config_required: false
111+
openshell_client_gateway_service_scope: user
112+
openshell_client_gateway_network_name: openshell
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
---
5+
# Root's packaged user unit can log to the system journal. Match journal
6+
# fields instead of --user so both root and tmachine user units are captured.
7+
- name: Capture installed gateway journal
8+
become: true
9+
ansible.builtin.command:
10+
argv: >-
11+
{{ ['journalctl']
12+
+ (['_SYSTEMD_USER_UNIT=openshell-gateway.service', '_UID=' ~ openshell_test_gateway.service_uid]
13+
if openshell_test_gateway.service_scope == 'user'
14+
else ['--unit', 'openshell-gateway.service'])
15+
+ ['--no-pager', '--lines', '200'] }}
16+
register: openshell_test_gateway_journal
17+
changed_when: false
18+
failed_when: false
19+
20+
- name: Show installed gateway journal
21+
ansible.builtin.debug:
22+
var: openshell_test_gateway_journal.stdout_lines

0 commit comments

Comments
 (0)