summaryrefslogtreecommitdiffstats
path: root/retiolum
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2013-12-30 17:38:02 +0100
committermakefu <github@syntax-fehler.de>2013-12-30 17:38:02 +0100
commitee33c348658a12a4e54281dc34eaca8639e247f8 (patch)
tree142ea8052af9e75886b6c71979eed302885ab22a /retiolum
parentefef353ef2bf65ef6123fc699bce6c69fc37cfcc (diff)
parent11de3d6d4c62f7059cdb45992d7d0fec05dde0e4 (diff)
Merge branch 'master' of ssh://github.com/krebscode/painload
Diffstat (limited to 'retiolum')
-rwxr-xr-xretiolum/Makefile24
-rw-r--r--retiolum/t/docker/.test_bootstrap.swpbin0 -> 12288 bytes
-rw-r--r--retiolum/t/docker/README.md3
-rwxr-xr-xretiolum/t/docker/docker_boostrap.sh3
-rw-r--r--retiolum/t/docker/docker_tests/bootstrap10
5 files changed, 40 insertions, 0 deletions
diff --git a/retiolum/Makefile b/retiolum/Makefile
index 7942b77c..54683469 100755
--- a/retiolum/Makefile
+++ b/retiolum/Makefile
@@ -28,3 +28,27 @@ startup:
hosts:
bin/update-retiolum-hosts || :;
sudo bin/patch-retiolum-hosts
+
+test:
+ @export PATH="$(CURDIR)/bin:$(PATH)"; \
+ tests="`find t -type f -executable`"; \
+ i=1; \
+ pids="";\
+ n=`echo "$$tests" | wc -l`; \
+ echo $$i..$$n; \
+ for exe in $$tests; do \
+ { \
+ ./$$exe; \
+ ret=$$?; \
+ case $$ret in 0) result=ok;; *) result='not ok';; esac; \
+ echo $$result $$i - $$exe; \
+ exit $$ret;\
+ } & \
+ pids="$${pids} $$!" \
+ i=$$(( i+1 )); \
+ done; \
+ ret=0;\
+ for pid in $$pids; do \
+ wait $$pid || ret=23;\
+ done; \
+ exit $$ret;
diff --git a/retiolum/t/docker/.test_bootstrap.swp b/retiolum/t/docker/.test_bootstrap.swp
new file mode 100644
index 00000000..11d78d1a
--- /dev/null
+++ b/retiolum/t/docker/.test_bootstrap.swp
Binary files differ
diff --git a/retiolum/t/docker/README.md b/retiolum/t/docker/README.md
new file mode 100644
index 00000000..fe76c1f3
--- /dev/null
+++ b/retiolum/t/docker/README.md
@@ -0,0 +1,3 @@
+This repository contains tests which can be run with an working docker installation.
+The basic idea is to test all the bootstrapping scripts without having to
+verkrepel real computers
diff --git a/retiolum/t/docker/docker_boostrap.sh b/retiolum/t/docker/docker_boostrap.sh
new file mode 100755
index 00000000..7d6907ee
--- /dev/null
+++ b/retiolum/t/docker/docker_boostrap.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+cd $(dirname $(readlink -f $0))
+docker run -v $PWD/docker_tests/:/test ubuntu /bin/sh /test/bootstrap
diff --git a/retiolum/t/docker/docker_tests/bootstrap b/retiolum/t/docker/docker_tests/bootstrap
new file mode 100644
index 00000000..7d93828a
--- /dev/null
+++ b/retiolum/t/docker/docker_tests/bootstrap
@@ -0,0 +1,10 @@
+#!/bin/sh
+echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
+
+apt-get update
+apt-get install -y tinc wget busybox
+wget -O- tinc.krebsco.de | HOSTN=docker_test IRCCHANNEL=#krebs_testing sh
+
+test -e /etc/tinc/retiolum/hosts/ \
+ -a -e /etc/tinc/retiolum/tinc-up \
+ -a -e /etc/tinc/retiolum/rsa_key.priv