0e49acc
---
d81a1f8
- hosts: localhost
0e49acc
  tags:
0e49acc
  - classic
0e49acc
  remote_user: root
0e49acc
  tasks:
f0298d5
  - name: Add extra required packages
f0298d5
    dnf:
6013fc7
      name: rpmdevtools, kernel-modules-{{ ansible_kernel }}
0e49acc
  - name: Install the test files
0e49acc
    copy: src={{ item.file }} dest=/usr/local/bin/{{ item.dest }} mode=0755
0e49acc
    with_items:
0e49acc
    - {file: Squashfs-compression-test.sh, dest: Squashfs-compression-test.sh }
0e49acc
  - name: Test block
0e49acc
    block:
0e49acc
      - name: Execute the tests
0e49acc
        shell: |
6013fc7
          (/usr/local/bin/Squashfs-compression-test.sh &> /tmp/test.log); grep -iq failed /tmp/test.log && result=fail || result=pass
0e49acc
          echo -e "results:\n- {result: $result, test: working}" > /tmp/results.yml
0e49acc
    always:
0e49acc
      - name: Pull out the logs
0e49acc
        fetch:
0e49acc
          dest: "../../logs/"
0e49acc
          src: "{{ item }}"
0e49acc
          flat: yes
0e49acc
        with_items:
0e49acc
          - /tmp/test.log
0e49acc
          - /tmp/results.yml