|
131 | 131 | tags: |
132 | 132 | - run_tests |
133 | 133 |
|
| 134 | +- name: Set the pathname of the results directory |
| 135 | + ansible.builtin.set_fact: |
| 136 | + nfstest_results_full_path: "{{ topdir_path }}/workflows/nfstest/results" |
| 137 | + nfstest_results_target: "../workflows/nfstest/results/last-run" |
| 138 | + when: |
| 139 | + - kdevops_workflows_dedicated_workflow|bool |
| 140 | + tags: copy_results |
| 141 | + |
| 142 | +- name: Clean up our localhost results/last-run directory |
| 143 | + local_action: file path="{{ nfstest_results_target }}/" state=absent |
| 144 | + run_once: true |
| 145 | + tags: [ 'run_tests', 'copy_results', 'clean_local_results' ] |
| 146 | + |
| 147 | +- name: Create empty last-run directory |
| 148 | + local_action: file path="{{ nfstest_results_target }}/" state=directory |
| 149 | + run_once: true |
| 150 | + tags: [ 'run_tests', 'copy_results', 'clean_local_results' ] |
| 151 | + |
134 | 152 | - name: Run the test group script on the target node |
135 | 153 | ansible.builtin.command: |
136 | 154 | cmd: "/tmp/runtest.sh" |
137 | 155 | when: |
138 | 156 | - kdevops_workflows_dedicated_workflow|bool |
139 | 157 | tags: run_tests |
140 | 158 |
|
141 | | -- name: Set the pathname of the results directory |
142 | | - ansible.builtin.set_fact: |
143 | | - nfstest_results_dir: "../workflows/nfstest/results/{{ ansible_kernel }}" |
144 | | - when: |
145 | | - - kdevops_workflows_dedicated_workflow|bool |
146 | | - tags: copy_results |
| 159 | +- name: Get used target kernel version |
| 160 | + tags: [ 'copy_results' ] |
| 161 | + command: "uname -r" |
| 162 | + register: uname_cmd |
| 163 | + |
| 164 | +- name: Store last kernel variable |
| 165 | + tags: [ 'copy_results' ] |
| 166 | + set_fact: |
| 167 | + last_kernel: "{{ uname_cmd.stdout_lines | regex_replace('\\]') | regex_replace('\\[') | replace(\"'\",'') }}" |
| 168 | + run_once: true |
| 169 | + |
| 170 | +- name: Document used target kernel version |
| 171 | + local_action: "shell echo {{ last_kernel }} > {{ nfstest_results_target }}/../last-kernel.txt" |
| 172 | + tags: [ 'run_tests', 'copy_results', 'print_results' ] |
| 173 | + run_once: true |
147 | 174 |
|
148 | 175 | - name: Create the results directory on the control node |
149 | 176 | ansible.builtin.file: |
150 | | - path: "{{ nfstest_results_dir }}" |
| 177 | + path: "{{ nfstest_results_full_path }}/last-run/{{ last_kernel }}" |
151 | 178 | state: directory |
152 | 179 | mode: "u=rwx,g=rx,o=rx" |
153 | 180 | delegate_to: localhost |
|
168 | 195 | - name: Copy the output logs to the control node |
169 | 196 | ansible.builtin.fetch: |
170 | 197 | src: "{{ item.path }}" |
171 | | - dest: "{{ nfstest_results_dir }}/{{ nfstest_test_group }}/" |
| 198 | + dest: "{{ nfstest_results_full_path }}/last-run/{{ last_kernel }}/{{ nfstest_test_group }}/" |
172 | 199 | flat: true |
173 | 200 | with_items: "{{ nfstest_logs.files }}" |
174 | 201 | loop_control: |
|
178 | 205 | - kdevops_workflows_dedicated_workflow|bool |
179 | 206 | changed_when: false |
180 | 207 | tags: copy_results |
| 208 | + |
| 209 | +- name: Verify last-run kernel directory exists |
| 210 | + tags: [ 'copy_results' ] |
| 211 | + delegate_to: localhost |
| 212 | + stat: |
| 213 | + path: "{{ nfstest_results_full_path }}/last-run/{{ last_kernel }}" |
| 214 | + register: last_run_kernel_dir |
| 215 | + |
| 216 | +- name: Copy over the last-run into the results directory for archiving into kdevops |
| 217 | + copy: |
| 218 | + src: "{{ nfstest_results_full_path }}/last-run/{{ last_kernel }}" |
| 219 | + dest: "{{ nfstest_results_full_path }}/" |
| 220 | + run_once: true |
| 221 | + tags: [ 'copy_results' ] |
| 222 | + delegate_to: localhost |
| 223 | + when: |
| 224 | + - last_run_kernel_dir.stat.exists |
0 commit comments