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.
This commit is contained in:
parent
e89b109bdc
commit
afc87975fa
@ -1,27 +1,11 @@
|
|||||||
---
|
|
||||||
- hosts: localhost
|
- hosts: localhost
|
||||||
vars:
|
roles:
|
||||||
- artifacts: ./artifacts
|
- role: standard-test-basic
|
||||||
tags:
|
tags:
|
||||||
- classic
|
- classic
|
||||||
remote_user: root
|
tests:
|
||||||
tasks:
|
- working:
|
||||||
- name: Install the test files
|
dir: .
|
||||||
copy: src={{ item.file }} dest=/usr/local/bin/{{ item.dest }} mode=0755
|
run: ansible-playbook --tags=classic wrapper_working.yml
|
||||||
with_items:
|
required_packages:
|
||||||
- {file: Squashfs-compression-test.sh, dest: Squashfs-compression-test.sh }
|
- rpmdevtools
|
||||||
- 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
|
|
||||||
|
27
tests/wrapper_working.yml
Normal file
27
tests/wrapper_working.yml
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user