--- - name: Setup test case prefix based on distro and release set_fact: test_case_prefix: >- {%- if ansible_distribution == "Fedora" -%} fedora_{{ ansible_distribution_version }}-{{ ansible_machine }} {%- else -%} rhel_{{ ansible_distribution_version }}-{{ ansible_machine }} {%- endif -%} - block: - name: "Run image test case: {{ test_case_prefix }}-{{ test_case }}" command: | {{ image_test_executable }} -test.v \ -test.timeout {{image_test_timeout * 60}}s \ {{ image_test_case_path }}/{{ test_case_prefix }}-{{ test_case }} args: chdir: "{{ tests_working_directory }}" register: test_cmd - name: "Mark test case as passed: {{ test_case_prefix }}-{{ test_case }}" set_fact: passed_tests: "{{ passed_tests + [ test_case_prefix + '-' + test_case ] }}" rescue: - name: "Mark test case as failed: {{ test_case_prefix }}-{{ test_case }}" set_fact: failed_tests: "{{ failed_tests + [ test_case_prefix + '-' + test_case ] }}" always: - name: "Write log for test case: {{ test_case_prefix }}-{{ test_case }}" copy: dest: "{{ workspace }}/{{ test_case_prefix }}-{{ test_case }}.log" content: | Logs from test case: {{ test_case_prefix }}-{{ test_case }} ---------------------------------------------------------------------- stderr: {{ test_cmd.stderr }} ---------------------------------------------------------------------- stdout: {{ test_cmd.stdout }}