|
11 | 11 | - name: Wait for SSH |
12 | 12 | ansible.builtin.wait_for_connection: |
13 | 13 |
|
| 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 | + |
14 | 29 | - name: Create Podman E2E test directory |
15 | 30 | become: true |
16 | 31 | ansible.builtin.file: |
|
46 | 61 | - "{{ podman_e2e_test_root }}/openshell-e2e-python-dev.tar" |
47 | 62 | environment: |
48 | 63 | 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 }}" |
60 | 65 |
|
61 | 66 | - name: Run Podman E2E archive tests |
62 | 67 | ansible.builtin.command: |
|
73 | 78 | - --no-fail-fast |
74 | 79 | environment: |
75 | 80 | CONTAINER_ENGINE: podman |
76 | | - CONTAINER_HOST: unix:///run/user/1000/podman/podman.sock |
| 81 | + CONTAINER_HOST: "unix://{{ tmachine_container_runtime_socket }}" |
77 | 82 | HOME: /home/tmachine |
78 | | - OPENSHELL_BIN: /usr/local/bin/openshell |
| 83 | + OPENSHELL_BIN: "{{ openshell_test_cli.stdout }}" |
79 | 84 | OPENSHELL_E2E_CONTAINER_ENGINE_UNSET_XDG_CONFIG_HOME: "1" |
80 | 85 | OPENSHELL_E2E_DRIVER: podman |
81 | | - OPENSHELL_E2E_NETWORK_NAME: tmachine |
| 86 | + OPENSHELL_E2E_NETWORK_NAME: "{{ openshell_test_gateway.network_name }}" |
82 | 87 | 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 }}" |
86 | 91 | register: podman_e2e_test_result |
87 | 92 | changed_when: false |
88 | 93 | failed_when: false |
|
95 | 100 | ansible.builtin.debug: |
96 | 101 | var: podman_e2e_test_result.stdout_lines |
97 | 102 |
|
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 |
110 | 107 | when: podman_e2e_test_result.rc != 0 |
111 | 108 |
|
112 | 109 | - name: Require Podman E2E archive success |
|
0 commit comments