Bruno Wolff III 0e49ac
---
Bruno Wolff III d81a1f
- hosts: localhost
Bruno Wolff III 4f08b3
  vars:
Bruno Wolff III 4f08b3
  - artifacts: "{{ lookup('env', 'TEST_ARTIFACTS')|default('./artifacts', true) }}"
Bruno Wolff III 0e49ac
  tags:
Bruno Wolff III 0e49ac
  - classic
Bruno Wolff III 0e49ac
  remote_user: root
Bruno Wolff III 0e49ac
  tasks:
Bruno Wolff III f0298d
  - name: Add extra required packages
Bruno Wolff III f0298d
    dnf:
Bruno Wolff III 6013fc
      name: rpmdevtools, kernel-modules-{{ ansible_kernel }}
Bruno Wolff III 0e49ac
  - name: Install the test files
Bruno Wolff III 0e49ac
    copy: src={{ item.file }} dest=/usr/local/bin/{{ item.dest }} mode=0755
Bruno Wolff III 0e49ac
    with_items:
Bruno Wolff III 0e49ac
    - {file: Squashfs-compression-test.sh, dest: Squashfs-compression-test.sh }
Bruno Wolff III 0e49ac
  - name: Test block
Bruno Wolff III 0e49ac
    block:
Bruno Wolff III 0e49ac
      - name: Execute the tests
Bruno Wolff III 0e49ac
        shell: |
Bruno Wolff III 6013fc
          (/usr/local/bin/Squashfs-compression-test.sh &> /tmp/test.log); grep -iq failed /tmp/test.log && result=fail || result=pass
Bruno Wolff III 0e49ac
          echo -e "results:\n- {result: $result, test: working}" > /tmp/results.yml
Bruno Wolff III 0e49ac
    always:
Bruno Wolff III 0e49ac
      - name: Pull out the logs
Bruno Wolff III 0e49ac
        fetch:
Bruno Wolff III 612a73
          dest: "{{ artifacts }}/"
Bruno Wolff III 0e49ac
          src: "{{ item }}"
Bruno Wolff III 0e49ac
          flat: yes
Bruno Wolff III 0e49ac
        with_items:
Bruno Wolff III 0e49ac
          - /tmp/test.log
Bruno Wolff III 0e49ac
          - /tmp/results.yml