2018-02-08 16:08:44 +00:00
|
|
|
---
|
|
|
|
- hosts: localhost
|
|
|
|
tags:
|
|
|
|
- classic
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
- name: Define remote_artifacts if it is not already defined
|
|
|
|
set_fact:
|
2018-02-09 16:05:33 +00:00
|
|
|
artifacts: ${HOME}/artifacts
|
|
|
|
when: artifacts is not defined
|
2018-02-08 16:08:44 +00:00
|
|
|
|
|
|
|
- name: Make artifacts directory
|
2018-02-09 16:05:33 +00:00
|
|
|
file: path={{ artifacts }} state=directory recurse=yes
|
2018-02-08 16:08:44 +00:00
|
|
|
|
|
|
|
- block:
|
|
|
|
- name: Execute tests
|
|
|
|
shell: |
|
2018-02-09 16:05:33 +00:00
|
|
|
logfile={{ artifacts }}/test.{{ item }}.log
|
2018-02-08 16:08:44 +00:00
|
|
|
exec 2>>$logfile 1>>$logfile
|
|
|
|
cd tests
|
|
|
|
#make script executable
|
|
|
|
chmod 0775 {{ item }}
|
|
|
|
#execute the test
|
|
|
|
python2 {{ item }}.py
|
|
|
|
if [ $? -eq 0 ]; then
|
2018-02-09 16:05:33 +00:00
|
|
|
echo "PASS {{ item }}" >> {{ artifacts }}/test.log
|
2018-02-08 16:08:44 +00:00
|
|
|
else
|
2018-02-09 16:05:33 +00:00
|
|
|
echo "FAIL {{ item }}" >> {{ artifacts }}/test.log
|
2018-02-08 16:08:44 +00:00
|
|
|
fi
|
|
|
|
with_items:
|
|
|
|
- "test_4GBsegfault"
|
|
|
|
- "test_big_file_in_archive"
|
|
|
|
- "test_long_path_in_archive"
|
|
|
|
- "test_many_files_in_archive"
|
|
|
|
- "test_umask"
|
|
|
|
- "test_umask_when_creating"
|
|
|
|
- "test_zipnote_fails_to_update_the_archive"
|
|
|
|
|
|
|
|
# Can't go in block. See
|
|
|
|
# https://github.com/ansible/ansible/issues/20736
|
|
|
|
- name: Check the results
|
2018-02-09 16:05:33 +00:00
|
|
|
shell: grep "^FAIL" {{ artifacts }}/test.log
|
2018-02-08 16:08:44 +00:00
|
|
|
register: test_fails
|
|
|
|
failed_when: test_fails.stdout or test_fails.stderr
|
|
|
|
|
|
|
|
|
|
|
|
|