Browse code

integration: add variable to set storage options for testing

Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>

Jörg Thalheim authored on 2015/04/15 15:39:15
Showing 2 changed files
... ...
@@ -8,6 +8,7 @@ DOCKER_ENVS := \
8 8
 	-e DOCKER_CLIENTONLY \
9 9
 	-e DOCKER_EXECDRIVER \
10 10
 	-e DOCKER_GRAPHDRIVER \
11
+	-e DOCKER_STORAGE_OPTS \
11 12
 	-e TESTDIRS \
12 13
 	-e TESTFLAGS \
13 14
 	-e TIMEOUT
... ...
@@ -16,6 +16,16 @@ export DOCKER_GRAPHDRIVER=${DOCKER_GRAPHDRIVER:-vfs}
16 16
 export DOCKER_EXECDRIVER=${DOCKER_EXECDRIVER:-native}
17 17
 export DOCKER_USERLANDPROXY=${DOCKER_USERLANDPROXY:-true}
18 18
 
19
+# example usage: DOCKER_STORAGE_OPTS="dm.basesize=20G,dm.loopdatasize=200G"
20
+storage_params=""
21
+if [ -n "$DOCKER_STORAGE_OPTS" ]; then
22
+	IFS=','
23
+	for i in ${DOCKER_STORAGE_OPTS}; do
24
+		storage_params="--storage-opt $i $storage_params"
25
+	done
26
+	unset IFS
27
+fi
28
+
19 29
 if [ -z "$DOCKER_TEST_HOST" ]; then
20 30
 	export DOCKER_HOST="unix://$(cd "$DEST" && pwd)/docker.sock" # "pwd" tricks to make sure $DEST is an absolute path, not a relative one
21 31
 	( set -x; exec \
... ...
@@ -25,6 +35,7 @@ if [ -z "$DOCKER_TEST_HOST" ]; then
25 25
 		--exec-driver "$DOCKER_EXECDRIVER" \
26 26
 		--pidfile "$DEST/docker.pid" \
27 27
 		--userland-proxy="$DOCKER_USERLANDPROXY" \
28
+		$storage_params \
28 29
 			&> "$DEST/docker.log"
29 30
 	) &
30 31
 	trap "source '${MAKEDIR}/.integration-daemon-stop'" EXIT # make sure that if the script exits unexpectedly, we stop this daemon we just started