Skip to content

Commit 8990656

Browse files
authored
test(tmachine): support package-installed Podman driver suites (#4107)
* test(tmachine): support package-installed Podman driver suites Signed-off-by: Evan Lezar <[email protected]> * test(tmachine): remove configuration-mirroring checks Signed-off-by: Evan Lezar <[email protected]> --------- Signed-off-by: Evan Lezar <[email protected]>
1 parent e9271cb commit 8990656

13 files changed

Lines changed: 216 additions & 79 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,9 @@ jobs:
305305
integration-inputs-artifact-id: ${{ needs.prepare-integration.outputs.integration_inputs_artifact_id }}
306306
test-matrix: >-
307307
[
308-
{"environment":"fedora-podman-rootful","installer":"binaries","testsuite":"driver-podman"},
309-
{"environment":"fedora-podman-rootless","installer":"binaries","testsuite":"e2e-podman"},
310-
{"environment":"fedora-podman-rootless","installer":"binaries","testsuite":"driver-podman"}
308+
{"environment":"fedora-podman-rootful","installer":"rpm","testsuite":"driver-podman"},
309+
{"environment":"fedora-podman-rootless","installer":"rpm","testsuite":"e2e-podman"},
310+
{"environment":"fedora-podman-rootless","installer":"rpm","testsuite":"driver-podman"}
311311
]
312312
313313
docker-e2e:

‎CI.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,10 @@ runs without optional E2E labels. Core integration qualification builds and inst
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: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,27 @@ Run the portable subset in a disposable rootless Podman guest:
290290

291291
```shell
292292
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
293+
nix run .#tmachine -- test fedora-podman-rootless rpm e2e-podman
294+
nix run .#tmachine -- test fedora-podman-rootless rpm driver-podman
295295
```
296296

297+
The driver suites also support the `binaries` installer. The shared installer
298+
roles save the active gateway configuration, registration name, service scope,
299+
service owner, and network name in `/var/lib/openshell-test/gateway.yaml`.
300+
Suites resolve `openshell` from PATH and use that registration, including the
301+
packaged gateway's HTTPS client credentials. Namespace fixtures modify the
302+
active qualification configuration and restart its system or user service.
303+
Failure diagnostics select the matching journal unit and user ID. Missing
304+
metadata or credentials fail the run; suites do not replace package setup with
305+
an HTTP gateway. Ansible sources participate in tmachine's installation cache
306+
hash, so older cached installations are rebuilt with this metadata.
307+
308+
The `driver-podman` suite supports rootful and rootless Podman. The
309+
`e2e-podman` archive requires rootless Podman for its host workload fixtures.
310+
DEB and RPM installers share the gateway role; available environments pair
311+
DEB with Ubuntu/Docker and RPM with Fedora/Podman. A DEB/Podman run requires an
312+
Ubuntu Podman environment.
313+
297314
Print the exact tmachine archive selection as a shell `PODMAN_CI_TESTS` array:
298315

299316
```shell

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

Lines changed: 5 additions & 1 deletion
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,7 +42,7 @@
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
4347

4448
- name: Require unconfigured Podman user namespaces

‎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: 10 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
@@ -38,21 +42,15 @@
3842
- name: Apply the Podman user-namespace fixture
3943
become: true
4044
ansible.builtin.blockinfile:
41-
path: /etc/openshell/gateway.toml
45+
path: "{{ openshell_test_gateway.config_path }}"
46+
insertafter: '^\[openshell\.drivers\.podman\]$'
4247
marker: "# {mark} OpenShell Podman userns test fixture"
4348
block: "{{ lookup('ansible.builtin.file', podman_userns_config) | trim }}"
4449

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
50+
- name: Restart installed gateway with the Podman user-namespace fixture
51+
ansible.builtin.include_role:
52+
name: openshell_test_gateway
53+
tasks_from: restart.yaml
5654

5755
- name: Capture direct Podman user-namespace mapping
5856
become: true

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,17 @@
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+
service_scope: "{{ openshell_client_gateway_service_scope | default('system') }}"
25+
service_user: "{{ openshell_gateway_user if openshell_client_gateway_service_scope | default('system') == 'user' else 'root' }}"
26+
service_home: "{{ openshell_gateway_home if openshell_client_gateway_service_scope | default('system') == 'user' else '/root' }}"
27+
service_uid: "{{ openshell_gateway_uid if openshell_client_gateway_service_scope | default('system') == 'user' else '0' }}"
28+
network_name: "{{ openshell_client_gateway_network_name | default('tmachine') }}"

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,6 @@
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: /var/lib/openshell-qualification/gateway.toml
110+
openshell_client_gateway_service_scope: user
111+
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)