squashfs-tools/tests/test_working.yml
Bruno Wolff III 4f08b31430 Change to supported method of referring to artifacts location
The documentation used to be wrong, but has been fixed. So the hack here
has been fixed as well.
2019-05-23 09:39:06 -05:00

31 lines
992 B
YAML

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