Browse Source

Initial run file, semi-fake config, move tests

Joe Ferguson 11 years ago
parent
commit
9626283978

+ 18 - 0
test/.config.sh

@@ -0,0 +1,18 @@
+#!/bin/bash
+set -e
+
+declare -A imageIncludeTests=()
+imageIncludeTests[python]=''
+imageIncludeTests[python]+='python'
+imageIncludeTests[python]+=' other-python'
+imageIncludeTests[python-onbuild]+=''
+imageIncludeTests[python-onbuild]+='py-onbuild'
+imageIncludeTests[python:3]+=''
+imageIncludeTests[python:3]+='py-3'
+
+declare -A globalExcludeTests=()
+globalExcludeTests[utc_hello-world]=1
+
+declare -A globalIncludeTests=()
+globalIncludeTests[utc]=''
+globalIncludeTests[many]='debian ... ubuntu'

+ 61 - 0
test/run.sh

@@ -0,0 +1,61 @@
+#!/bin/bash
+set -e
+
+dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
+
+self="$(basename "$0")"
+
+usage() {
+	cat <<EOUSAGE
+
+usage: $self [-t test ...] [imageTag ...]
+   ie: $self debian:wheezy
+       $self -t utc python:3-onbuild
+       $self -t utc python:3-onbuild -t py-onbuild
+
+This script processes the specified docker images to test their running
+environments.
+EOUSAGE
+}
+
+# arg handling
+opts="$(getopt -o 'ht:?' --long 'dry-run,help,test:' -- "$@" || { usage >&2 && false; })"
+eval set -- "$opts"
+
+tests=()
+dryRun=
+while true; do
+	flag=$1
+	shift
+	case "$flag" in
+		--dry-run)  dryRun=1 ;;
+		--help|-h|'-?') usage && exit 0 ;;
+		--test|-t) tests+=( "$1" ) && shift ;;
+		--) break ;;
+		*)
+			{
+				echo "error: unknown flag: $flag"
+				usage
+			} >&2
+			exit 1
+			;;
+	esac
+done
+
+# load config lists
+# contains:
+#   imageIncludeTests
+#   globalExcludeTests
+#   globalIncludeTests
+. "$dir"/.config.sh
+
+for image in "$@"; do
+	noNamespace="${image##*/}"
+	repo="${noNamespace%:*}"
+	tagVar="${noNamespace#*:}"
+	#version="${tagVar%-*}"
+	variant="${tagVar##*-}"
+	
+	# TODO tests
+	echo 'full:'$image 'repo:'$repo 'variant:'$variant
+done

+ 0 - 0
test/python-artifacts/test-hy.sh → test/tests/python-artifacts/test-hy.sh


+ 0 - 0
test/python-artifacts/test-pip-requests-ssl.py → test/tests/python-artifacts/test-pip-requests-ssl.py


+ 0 - 0
test/python-artifacts/test-sqlite3.py → test/tests/python-artifacts/test-sqlite3.py


+ 0 - 0
test/python-artifacts/test-zlib.py → test/tests/python-artifacts/test-zlib.py


+ 0 - 0
test/python.sh → test/tests/python.sh


+ 0 - 0
test/utc.sh → test/tests/utc.sh