summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cholerab/Testing17
-rw-r--r--retiolum/t/docker/README.md4
-rwxr-xr-xretiolum/t/docker/docker_boostrap.sh2
-rw-r--r--ship/Makefile24
-rwxr-xr-xship/t/docker/docker_remote_punani.sh3
-rw-r--r--ship/t/docker/punani/remote_punani11
6 files changed, 60 insertions, 1 deletions
diff --git a/cholerab/Testing b/cholerab/Testing
new file mode 100644
index 00000000..0f0d78ef
--- /dev/null
+++ b/cholerab/Testing
@@ -0,0 +1,17 @@
+# Tests in Painload
+every subdir in // `should` contain a Makefile which supports 'make test'.
+The exit code must be 0 if all tests went fine, not 1 if some tests of the
+subdirectory fucked up.
+
+//util //retiolum and //ship are currently using an asynchronous test runner
+which outputs test results in TAP (test anything protocol) format.
+
+# Docker Tests
+Some Tests are using docker as a container testing facility. These tests
+contain of a runner script for the make test command and a script which
+will be run in the docker container.
+For examples see //retiolum/t/docker/
+
+# Continuous Integration
+currently we are running CI with buildbot on http://cband:8010 .
+Configuration is in krebs:ci/buildbot .
diff --git a/retiolum/t/docker/README.md b/retiolum/t/docker/README.md
index fe76c1f3..a33d665f 100644
--- a/retiolum/t/docker/README.md
+++ b/retiolum/t/docker/README.md
@@ -1,3 +1,7 @@
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
+
+Currently there is a test runner in this directory and a test script for the docker
+instance in `docker_tests/`
+
diff --git a/retiolum/t/docker/docker_boostrap.sh b/retiolum/t/docker/docker_boostrap.sh
index 7d6907ee..7ae3fd36 100755
--- a/retiolum/t/docker/docker_boostrap.sh
+++ b/retiolum/t/docker/docker_boostrap.sh
@@ -1,3 +1,3 @@
#!/bin/sh
cd $(dirname $(readlink -f $0))
-docker run -v $PWD/docker_tests/:/test ubuntu /bin/sh /test/bootstrap
+docker run -v $PWD/docker_tests/:/test ubuntu /bin/sh /test/bootstrap >/dev/null
diff --git a/ship/Makefile b/ship/Makefile
index 0e9b8edf..4805613d 100644
--- a/ship/Makefile
+++ b/ship/Makefile
@@ -30,3 +30,27 @@ $(foreach exe, $(exesrcs), $(eval $(call buildrule,$(exe))))
$(finoutdir)/%: $(tmpoutdir)/%
cp $< $@
+
+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/ship/t/docker/docker_remote_punani.sh b/ship/t/docker/docker_remote_punani.sh
new file mode 100755
index 00000000..76e34068
--- /dev/null
+++ b/ship/t/docker/docker_remote_punani.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+cd $(dirname $(readlink -f $0))
+docker run -v $PWD/punani/:/test ubuntu /bin/sh /test/remote_punani >/dev/null
diff --git a/ship/t/docker/punani/remote_punani b/ship/t/docker/punani/remote_punani
new file mode 100644
index 00000000..4d8570e3
--- /dev/null
+++ b/ship/t/docker/punani/remote_punani
@@ -0,0 +1,11 @@
+#!/bin/sh
+rhost=http://conf.krebsco.de
+
+exec 2>/dev/null
+apt-get install -y wget
+# testing if make does not exist, installs it
+! ( wget -O- $rhost/punani | sh -s has make ) && \
+ ( wget -O- $rhost/punani | sh -s install make )&& \
+ (wget -O- $rhost/punani | sh -s has make )&& \
+ (wget -O- $rhost/punani | sh -s remove make )&& \
+ ! ( wget -O- $rhost/punani | sh -s has make )