zip/tests/tests.yml

48 lines
1.3 KiB
YAML
Raw Normal View History

---
- 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
- name: Make artifacts directory
2018-02-09 16:05:33 +00:00
file: path={{ artifacts }} state=directory recurse=yes
- block:
- name: Execute tests
shell: |
2018-02-09 16:05:33 +00:00
logfile={{ artifacts }}/test.{{ item }}.log
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
else
2018-02-09 16:05:33 +00:00
echo "FAIL {{ item }}" >> {{ artifacts }}/test.log
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
register: test_fails
failed_when: test_fails.stdout or test_fails.stderr