Add support for linux-system-api test harness

Also add a simple test that runs the role without any parameters.
This commit is contained in:
Lars Karlitski 2017-04-28 17:32:23 +02:00
parent 9b21e84f47
commit 69134b7cb7
5 changed files with 46 additions and 0 deletions

17
run-tests.sh Executable file
View file

@ -0,0 +1,17 @@
#!/bin/bash
# Run integration test for this repository. It fetches the test harness from
# docker.io, which is built from
#
# http://github.com/linux-system-roles/test-harness
set -xeuf -o pipefail
CACHEDIR=${CACHEDIR:-$PWD/.image-cache}
mkdir -p $CACHEDIR
docker run --privileged \
--rm \
--volume $PWD:/role \
--volume $CACHEDIR:/cache \
cockpit/linux-system-roles-test

22
semaphore Executable file
View file

@ -0,0 +1,22 @@
#!/bin/bash
# Run integration tests on semaphoreci.com.
set -xeuf -o pipefail
prepare() {
# install qemu because its post install script sets up /dev/kvm
sudo apt-get update
sudo apt-get install -q -y qemu-system-x86
sudo chmod a+rw /dev/kvm
}
run() {
docker-cache restore
CACHEDIR=$SEMAPHORE_CACHE_DIR ./run-tests.sh | tee
docker-cache snapshot
}
"$@"

2
test/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
/*.retry
/inventory

1
test/roles/network Symbolic link
View file

@ -0,0 +1 @@
../..

4
test/test_default.yml Normal file
View file

@ -0,0 +1,4 @@
---
- hosts: all
roles:
- network