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