mirror of
https://github.com/linux-system-roles/network.git
synced 2026-07-28 13:33:57 +00:00
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:
parent
9b21e84f47
commit
69134b7cb7
5 changed files with 46 additions and 0 deletions
17
run-tests.sh
Executable file
17
run-tests.sh
Executable 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
22
semaphore
Executable 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
2
test/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
/*.retry
|
||||
/inventory
|
||||
1
test/roles/network
Symbolic link
1
test/roles/network
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../..
|
||||
4
test/test_default.yml
Normal file
4
test/test_default.yml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
- hosts: all
|
||||
roles:
|
||||
- network
|
||||
Loading…
Add table
Add a link
Reference in a new issue