Add CI tests using the standard test interface
This commit is contained in:
parent
5d96c91e31
commit
bb3ec339f7
2
tests/.gitignore
vendored
Normal file
2
tests/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
*.swp
|
||||||
|
*.retry
|
11
tests/test-simple
Normal file
11
tests/test-simple
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
# exercise installed gzip/gunzip programs
|
||||||
|
echo "Bla" > bla.file
|
||||||
|
cp bla.file bla.file.orig
|
||||||
|
gzip bla.file
|
||||||
|
gunzip bla.file.gz
|
||||||
|
cmp bla.file bla.file.orig
|
||||||
|
echo "hi"
|
||||||
|
rm bla.file bla.file.orig
|
32
tests/test_simple.yml
Normal file
32
tests/test_simple.yml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
- hosts: localhost
|
||||||
|
vars:
|
||||||
|
- artifacts: ./artifacts
|
||||||
|
tags:
|
||||||
|
- atomic
|
||||||
|
- classic
|
||||||
|
- container
|
||||||
|
remote_user: root
|
||||||
|
tasks:
|
||||||
|
- name: Create the folder where we will store the tests
|
||||||
|
action: file state=directory path={{ item }}
|
||||||
|
owner=root group=root
|
||||||
|
with_items:
|
||||||
|
- /usr/local/bin
|
||||||
|
|
||||||
|
- name: Install the test files
|
||||||
|
copy: src={{ item.file }} dest=/usr/local/bin/{{ item.dest }}
|
||||||
|
mode=0755
|
||||||
|
with_items:
|
||||||
|
- {file: test-simple, dest: test-simple }
|
||||||
|
|
||||||
|
- block:
|
||||||
|
- name: Execute the tests
|
||||||
|
shell: exec > /tmp/test.log && /usr/local/bin/test-simple 2>&1
|
||||||
|
|
||||||
|
- always:
|
||||||
|
- name: Pull out the logs
|
||||||
|
fetch:
|
||||||
|
dest: "{{ artifacts }}/"
|
||||||
|
src: "/tmp/test.log"
|
||||||
|
flat: yes
|
1
tests/tests.yml
Normal file
1
tests/tests.yml
Normal file
@ -0,0 +1 @@
|
|||||||
|
- include: test_simple.yml
|
Loading…
Reference in New Issue
Block a user