From afc87975fa7bb5598c25465c8e6332839a542375 Mon Sep 17 00:00:00 2001 From: Bruno Wolff III Date: Tue, 21 May 2019 18:46:21 -0500 Subject: [PATCH] Try calling tests using ansible-playbook I'm guessing that the wrapper isn't supposed to be run directly, but should be run using ansible-playbook from a test using the basic role. --- tests/test_working.yml | 36 ++++++++++-------------------------- tests/wrapper_working.yml | 27 +++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 26 deletions(-) create mode 100644 tests/wrapper_working.yml diff --git a/tests/test_working.yml b/tests/test_working.yml index c542b61..f71a9e4 100644 --- a/tests/test_working.yml +++ b/tests/test_working.yml @@ -1,27 +1,11 @@ ---- - hosts: localhost - vars: - - artifacts: ./artifacts - tags: - - classic - remote_user: root - tasks: - - 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 + roles: + - role: standard-test-basic + tags: + - classic + tests: + - working: + dir: . + run: ansible-playbook --tags=classic wrapper_working.yml + required_packages: + - rpmdevtools diff --git a/tests/wrapper_working.yml b/tests/wrapper_working.yml new file mode 100644 index 0000000..c542b61 --- /dev/null +++ b/tests/wrapper_working.yml @@ -0,0 +1,27 @@ +--- +- hosts: localhost + vars: + - artifacts: ./artifacts + tags: + - classic + remote_user: root + tasks: + - 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