Fixes for zip tests

This commit is contained in:
esakaiev@redhat.com 2018-02-09 18:05:33 +02:00
parent aa3f4dccc7
commit 5bfd267546

View File

@ -3,28 +3,19 @@
tags:
- classic
vars:
- artifacts: "{{ lookup('env', 'TEST_ARTIFACTS')|default('./artifacts', true) }}"
tasks:
- name: Define remote_artifacts if it is not already defined
set_fact:
remote_artifacts: /home/${USER}/artifacts
when: remote_artifacts is not defined
- name: Copy tests to target
synchronize:
src: "{{ playbook_dir }}/"
dest: /home/${USER}/bin/
ssh_args: "-o UserKnownHostsFile=/dev/null"
artifacts: ${HOME}/artifacts
when: artifacts is not defined
- name: Make artifacts directory
file: path={{ remote_artifacts }} state=directory recurse=yes
file: path={{ artifacts }} state=directory recurse=yes
- block:
- name: Execute tests
shell: |
logfile={{ remote_artifacts }}/test.{{ item }}.log
logfile={{ artifacts }}/test.{{ item }}.log
exec 2>>$logfile 1>>$logfile
cd tests
#make script executable
@ -32,9 +23,9 @@
#execute the test
python2 {{ item }}.py
if [ $? -eq 0 ]; then
echo "PASS {{ item }}" >> {{ remote_artifacts }}/test.log
echo "PASS {{ item }}" >> {{ artifacts }}/test.log
else
echo "FAIL {{ item }}" >> {{ remote_artifacts }}/test.log
echo "FAIL {{ item }}" >> {{ artifacts }}/test.log
fi
with_items:
- "test_4GBsegfault"
@ -45,19 +36,10 @@
- "test_umask_when_creating"
- "test_zipnote_fails_to_update_the_archive"
- name: Pull out the logs
synchronize:
dest: "{{ artifacts }}/"
src: "{{ remote_artifacts }}/"
mode: pull
ssh_args: "-o UserKnownHostsFile=/dev/null"
when: artifacts|default("") != ""
# Can't go in block. See
# https://github.com/ansible/ansible/issues/20736
- name: Check the results
shell: grep "^FAIL" {{ remote_artifacts }}/test.log
shell: grep "^FAIL" {{ artifacts }}/test.log
register: test_fails
failed_when: test_fails.stdout or test_fails.stderr