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