Skip to content

Commit 0f95bee

Browse files
committed
test(tmachine): run e2e-podman against the packaged gateway
Detect the installer in the e2e-podman playbook: the binaries installer keeps its HTTP gateway, and the package installers use /usr/bin/openshell and the registered openshell gateway. Run the lane on rpm in CI. Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent b2185bc commit 0f95bee

6 files changed

Lines changed: 33 additions & 15 deletions

File tree

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,7 @@ jobs:
462462
secrets:
463463
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
464464

465-
# Run the Podman e2e suite on tmachine. It needs the binary installer's CLI
466-
# path and local HTTP gateway.
465+
# Run the Podman e2e suite on tmachine against the packaged gateway.
467466
podman-e2e-integration:
468467
needs: prepare-integration
469468
permissions:
@@ -477,7 +476,7 @@ jobs:
477476
integration-inputs-artifact-id: ${{ needs.prepare-integration.outputs.integration_inputs_artifact_id }}
478477
test-matrix: >-
479478
[
480-
{"environment":"fedora-podman-rootless","installer":"binaries","testsuite":"e2e-podman"}
479+
{"environment":"fedora-podman-rootless","installer":"rpm","testsuite":"e2e-podman"}
481480
]
482481
483482
docker-e2e:

‎.github/workflows/integration-runner.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ on:
2424
type: string
2525
default: >-
2626
[
27-
{"environment":"fedora-podman-rootless","installer":"binaries","testsuite":"e2e-podman"}
27+
{"environment":"fedora-podman-rootless","installer":"rpm","testsuite":"e2e-podman"}
2828
]
2929
3030
permissions:

‎.github/workflows/integration-test.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ on:
2727
type: string
2828
default: >-
2929
[
30-
{"environment":"fedora-podman-rootless","installer":"binaries","testsuite":"e2e-podman"}
30+
{"environment":"fedora-podman-rootless","installer":"rpm","testsuite":"e2e-podman"}
3131
]
3232
3333
permissions:

‎CI.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,8 @@ images. Release Dev, Release, and Pre-release use the same package installers.
169169
The feature suites (`tests/suites/features`) and the Podman driver suite
170170
(`tests/suites/drivers/podman`) run the same way, on the package installers; the
171171
driver suite's environments merge their Podman settings into the packaged
172-
gateway's configuration (see `TESTING.md`). The `e2e-podman` lane retains the
173-
binary installer because its playbook assumes that installer's system service,
174-
local HTTP gateway, and CLI path. The driver suite and `e2e-podman` run
172+
gateway's configuration (see `TESTING.md`). The `e2e-podman` lane runs on the
173+
RPM installer as well. The driver suite and `e2e-podman` run
175174
only in `Branch E2E Checks`. The manual Integration Tests workflow runs the
176175
remaining tmachine testsuites, such as `e2e-podman`, and downloads the packages
177176
selected by its matrix.

‎TESTING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ Run the portable subset in a disposable rootless Podman guest:
541541

542542
```shell
543543
nix run .#build-artifacts
544-
nix run .#tmachine -- test fedora-podman-rootless binaries e2e-podman
544+
nix run .#tmachine -- test fedora-podman-rootless rpm e2e-podman
545545
```
546546

547547
Print the exact tmachine archive selection as a shell `PODMAN_CI_TESTS` array:

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

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,30 @@
4848
HOME: /home/tmachine
4949
XDG_RUNTIME_DIR: /run/user/1000
5050

51+
# The binaries installer runs a plain-HTTP gateway named tmachine from a
52+
# system service and puts the CLI in /usr/local/bin. The package installers
53+
# run the packaged user service, install the CLI in /usr/bin and register
54+
# the gateway as openshell, using the package default network and namespace.
55+
- name: Detect the installer
56+
ansible.builtin.stat:
57+
path: /usr/local/bin/openshell
58+
register: podman_e2e_binaries_cli
59+
60+
- name: Select the gateway under test
61+
ansible.builtin.set_fact:
62+
podman_e2e_binaries: "{{ podman_e2e_binaries_cli.stat.exists }}"
63+
podman_e2e_cli: "{{ '/usr/local/bin/openshell' if podman_e2e_binaries_cli.stat.exists else '/usr/bin/openshell' }}"
64+
podman_e2e_gateway: "{{ 'tmachine' if podman_e2e_binaries_cli.stat.exists else 'openshell' }}"
65+
5166
- name: Remove any previous OpenShell gateway registration
67+
when: podman_e2e_binaries
5268
ansible.builtin.command:
5369
argv: [/usr/local/bin/openshell, gateway, remove, tmachine]
5470
changed_when: false
5571
failed_when: false
5672

5773
- name: Register the configured OpenShell gateway
74+
when: podman_e2e_binaries
5875
ansible.builtin.command:
5976
argv: [/usr/local/bin/openshell, gateway, add, http://127.0.0.1:17670, --local, --name, tmachine]
6077

@@ -75,12 +92,12 @@
7592
CONTAINER_ENGINE: podman
7693
CONTAINER_HOST: unix:///run/user/1000/podman/podman.sock
7794
HOME: /home/tmachine
78-
OPENSHELL_BIN: /usr/local/bin/openshell
95+
OPENSHELL_BIN: "{{ podman_e2e_cli }}"
7996
OPENSHELL_E2E_CONTAINER_ENGINE_UNSET_XDG_CONFIG_HOME: "1"
8097
OPENSHELL_E2E_DRIVER: podman
81-
OPENSHELL_E2E_NETWORK_NAME: tmachine
82-
OPENSHELL_E2E_SANDBOX_NAMESPACE: tmachine
83-
OPENSHELL_GATEWAY: tmachine
98+
OPENSHELL_E2E_NETWORK_NAME: "{{ podman_e2e_gateway }}"
99+
OPENSHELL_E2E_SANDBOX_NAMESPACE: "{{ podman_e2e_gateway }}"
100+
OPENSHELL_GATEWAY: "{{ podman_e2e_gateway }}"
84101
OPENSHELL_PODMAN_SOCKET: /run/user/1000/podman/podman.sock
85102
XDG_RUNTIME_DIR: /run/user/1000
86103
register: podman_e2e_test_result
@@ -96,9 +113,12 @@
96113
var: podman_e2e_test_result.stdout_lines
97114

98115
- name: Capture OpenShell gateway journal after Podman E2E test failure
99-
become: true
116+
become: "{{ podman_e2e_binaries }}"
100117
ansible.builtin.command:
101-
argv: [journalctl, --unit, openshell-gateway.service, --no-pager, --lines, "200"]
118+
argv: >-
119+
{{ ['journalctl', '--unit', 'openshell-gateway.service', '--no-pager', '--lines', '200']
120+
if podman_e2e_binaries else
121+
['journalctl', '--user-unit', 'openshell-gateway.service', '--no-pager', '--lines', '200'] }}
102122
changed_when: false
103123
failed_when: false
104124
when: podman_e2e_test_result.rc != 0

0 commit comments

Comments
 (0)