Merge branch 'master' into weekly
diff --git a/Dockerfile b/Dockerfile
index 8b838e9..20a6d54 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,16 +1,22 @@
-FROM java:8u45-jdk
+FROM java:8-jdk
 
-RUN apt-get update && apt-get install -y wget git curl zip && rm -rf /var/lib/apt/lists/*
+RUN apt-get update && apt-get install -y git curl zip && rm -rf /var/lib/apt/lists/*
 
 ENV JENKINS_HOME /var/jenkins_home
 ENV JENKINS_SLAVE_AGENT_PORT 50000
 
-# Jenkins is ran with user `jenkins`, uid = 1000
-# If you bind mount a volume from host/volume from a data container, 
-# ensure you use same uid
-RUN useradd -d "$JENKINS_HOME" -u 1000 -m -s /bin/bash jenkins
+ARG user=jenkins
+ARG group=jenkins
+ARG uid=1000
+ARG gid=1000
 
-# Jenkins home directoy is a volume, so configuration and build history 
+# Jenkins is run with user `jenkins`, uid = 1000
+# If you bind mount a volume from the host or a data container, 
+# ensure you use the same uid
+RUN groupadd -g ${gid} ${group} \
+    && useradd -d "$JENKINS_HOME" -u ${uid} -g ${gid} -m -s /bin/bash ${user}
+
+# Jenkins home directory is a volume, so configuration and build history 
 # can be persisted and survive image upgrades
 VOLUME /var/jenkins_home
 
@@ -22,22 +28,24 @@
 ENV TINI_SHA 066ad710107dc7ee05d3aa6e4974f01dc98f3888
 
 # Use tini as subreaper in Docker container to adopt zombie processes 
-RUN curl -fL https://github.com/krallin/tini/releases/download/v0.5.0/tini-static -o /bin/tini && chmod +x /bin/tini \
-  && echo "$TINI_SHA /bin/tini" | sha1sum -c -
+RUN curl -fsSL https://github.com/krallin/tini/releases/download/v0.5.0/tini-static -o /bin/tini && chmod +x /bin/tini \
+  && echo "$TINI_SHA  /bin/tini" | sha1sum -c -
 
 COPY init.groovy /usr/share/jenkins/ref/init.groovy.d/tcp-slave-agent-port.groovy
 
-ENV JENKINS_VERSION 1.631
-# curl http://repo.jenkins-ci.org/simple/releases/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war.sha1
-ENV JENKINS_SHA 304939b99c7b5399af1ea286e819296ee7106713
+ARG JENKINS_VERSION
+ENV JENKINS_VERSION ${JENKINS_VERSION:-1.651.2}
+ARG JENKINS_SHA
+ENV JENKINS_SHA ${JENKINS_SHA:-f61b8b604acba5076a93dcde28c0be2561d17bde}
+
 
 # could use ADD but this one does not check Last-Modified header 
 # see https://github.com/docker/docker/issues/8331
-RUN curl -fL http://mirrors.jenkins-ci.org/war/$JENKINS_VERSION/jenkins.war -o /usr/share/jenkins/jenkins.war \
-  && echo "$JENKINS_SHA /usr/share/jenkins/jenkins.war" | sha1sum -c -
+RUN curl -fsSL http://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war -o /usr/share/jenkins/jenkins.war \
+  && echo "$JENKINS_SHA  /usr/share/jenkins/jenkins.war" | sha1sum -c -
 
-ENV JENKINS_UC https://updates.jenkins-ci.org
-RUN chown -R jenkins "$JENKINS_HOME" /usr/share/jenkins/ref
+ENV JENKINS_UC https://updates.jenkins.io
+RUN chown -R ${user} "$JENKINS_HOME" /usr/share/jenkins/ref
 
 # for main web interface:
 EXPOSE 8080
@@ -47,10 +55,11 @@
 
 ENV COPY_REFERENCE_FILE_LOG $JENKINS_HOME/copy_reference_file.log
 
-USER jenkins
+USER ${user}
 
 COPY jenkins.sh /usr/local/bin/jenkins.sh
 ENTRYPOINT ["/bin/tini", "--", "/usr/local/bin/jenkins.sh"]
 
-# from a derived Dockerfile, can use `RUN plugin.sh active.txt` to setup /usr/share/jenkins/ref/plugins from a support bundle
+# from a derived Dockerfile, can use `RUN plugins.sh active.txt` to setup /usr/share/jenkins/ref/plugins from a support bundle
 COPY plugins.sh /usr/local/bin/plugins.sh
+COPY install-plugin.sh /usr/local/bin/install-plugin.sh
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000..f1f5202
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,11 @@
+node('docker') {
+  stage 'Checkout'
+  checkout scm
+
+  stage 'Build'
+  docker.build('jenkins')
+
+  stage 'Test'
+  sh "git checkout https://github.com/sstephenson/bats.git"
+  sh "bats/bin/bats tests/tests.bats"
+}
diff --git a/README.md b/README.md
index b6aa5f3..99f8027 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,10 @@
 
 The Jenkins Continuous Integration and Delivery server.
 
-This is a fully functional Jenkins server, based on the Long Term Support release
-http://jenkins-ci.org/
+This is a fully functional Jenkins server, based on the Long Term Support release.
+[http://jenkins.io/](http://jenkins.io/).
+
+For weekly releases check out [`jenkinsci/jenkins`](https://hub.docker.com/r/jenkinsci/jenkins/)
 
 
 <img src="http://jenkins-ci.org/sites/default/files/jenkins_logo.png"/>
@@ -15,6 +17,8 @@
 docker run -p 8080:8080 -p 50000:50000 jenkins
 ```
 
+NOTE: read below the _build executors_ part for the role of the `50000` port mapping.
+
 This will store the workspace in /var/jenkins_home. All Jenkins data lives in there - including plugins and configuration.
 You will probably want to make that a persistent volume (recommended):
 
@@ -50,8 +54,9 @@
 
 You can specify and set the number of executors of your Jenkins master instance using a groovy script. By default its set to 2 executors, but you can extend the image and change it to your desired number of executors :
 
+`executors.groovy`
 ```
-# executors.groovy
+import jenkins.model.*
 Jenkins.instance.setNumExecutors(5)
 ```
 
@@ -65,19 +70,37 @@
 
 # Attaching build executors
 
-You can run builds on the master (out of the box) but if you want to attach build slave servers: make sure you map the port: ```-p 50000:50000``` - which will be used when you connect a slave agent.
+You can run builds on the master out of the box.
 
-<a href="https://registry.hub.docker.com/u/maestrodev/build-agent/">Here</a> is an example docker container you can use as a build server with lots of good tools installed - which is well worth trying.
+But if you want to attach build slave servers **through JNLP (Java Web Start)**: make sure you map the port: ```-p 50000:50000``` - which will be used when you connect a slave agent.
+
+If you are only using [SSH slaves](https://wiki.jenkins-ci.org/display/JENKINS/SSH+Slaves+plugin), then you do **NOT** need to put that port mapping.
 
 # Passing JVM parameters
 
-You might need to customize the JVM running Jenkins, typically to pass system properties or tweak heap memory settings. Use JAVA_OPTS environment 
+You might need to customize the JVM running Jenkins, typically to pass system properties or tweak heap memory settings. Use JAVA_OPTS environment
 variable for this purpose :
 
 ```
 docker run --name myjenkins -p 8080:8080 -p 50000:50000 --env JAVA_OPTS=-Dhudson.footerURL=http://mycompany.com jenkins
 ```
 
+# Configuring logging
+
+Jenkins logging can be configured through a properties file and `java.util.logging.config.file` Java property.
+For example:
+
+```
+mkdir data
+cat > data/log.properties <<EOF
+handlers=java.util.logging.ConsoleHandler
+jenkins.level=FINEST
+java.util.logging.ConsoleHandler.level=FINEST
+EOF
+docker run --name myjenkins -p 8080:8080 -p 50000:50000 --env JAVA_OPTS="-Djava.util.logging.config.file=/var/jenkins_home/log.properties" -v `pwd`/data:/var/jenkins_home jenkins
+```
+
+
 # Passing Jenkins launcher parameters
 
 Argument you pass to docker running the jenkins image are passed to jenkins launcher, so you can run for sample :
@@ -112,7 +135,7 @@
 
 # Installing more tools
 
-You can run your container as root - and install via apt-get, install as part of build steps via jenkins tool installers, or you can create your own Dockerfile to customise, for example: 
+You can run your container as root - and install via apt-get, install as part of build steps via jenkins tool installers, or you can create your own Dockerfile to customise, for example:
 
 ```
 FROM jenkins
@@ -122,7 +145,7 @@
 USER jenkins # drop back to the regular jenkins user - good practice
 ```
 
-In such a derived image, you can customize your jenkins instance with hook scripts or additional plugins. 
+In such a derived image, you can customize your jenkins instance with hook scripts or additional plugins.
 For this purpose, use `/usr/share/jenkins/ref` as a place to define the default JENKINS_HOME content you
 wish the target installation to look like :
 
@@ -133,22 +156,59 @@
 RUN /usr/local/bin/plugins.sh /usr/share/jenkins/ref/plugins.txt
 ```
 
-When jenkins container starts, it will check JENKINS_HOME has this reference content, and copy them there if required. It will not override such files, so if you upgraded some plugins from UI they won't be reverted on next start.
+When jenkins container starts, it will check JENKINS_HOME has this reference content, and copy them
+there if required. It will not override such files, so if you upgraded some plugins from UI they won't
+be reverted on next start.
+
+In case you *do* want to override, append '.override' to the name of the reference file. E.g. a file named
+`/usr/share/jenkins/ref/config.xml.override` will overwrite an existing `config.xml` file in JENKINS_HOME.
 
 Also see [JENKINS-24986](https://issues.jenkins-ci.org/browse/JENKINS-24986)
 
-For your convenience, you also can use a plain text file to define plugins to be installed (using core-support plugin format)
+## Preinstalling plugins
+
+For your convenience, you also can use a plain text file to define plugins to be installed
+(using core-support plugin format).
+All plugins need to be listed in the form `pluginID:version` as there is no transitive dependency resolution.
+
 ```
-pluginID:version
-anotherPluginID:version
+credentials:1.18
+maven-plugin:2.7.1
+...
 ```
-And in derived Dockerfile just invoke the utility plugin.sh script
+
+And in derived Dockerfile just invoke the utility `plugins.sh` script
+
 ```
 FROM jenkins
 COPY plugins.txt /usr/share/jenkins/plugins.txt
 RUN /usr/local/bin/plugins.sh /usr/share/jenkins/plugins.txt
 ```
 
+Here is an example to get the list of plugins from an existing server you can use the following curl command:
+
+```
+JENKINS_HOST=username:password@myhost.com:port
+curl -sSL "http://$JENKINS_HOST/pluginManager/api/xml?depth=1&xpath=/*/*/shortName|/*/*/version&wrapper=plugins" | perl -pe 's/.*?<shortName>([\w-]+).*?<version>([^<]+)()(<\/\w+>)+/\1 \2\n/g'|sed 's/ /:/'
+```
+
+Example Output:
+
+```
+cucumber-testresult-plugin:0.8.2
+pam-auth:1.1
+matrix-project:1.4.1
+script-security:1.13
+...
+```
+
+For 2.x-derived images, you may also want to
+
+    RUN echo 2.0 > /usr/share/jenkins/ref/jenkins.install.UpgradeWizard.state
+
+to indicate that this Jenkins installation is fully configured.
+Otherwise a banner will appear prompting the user to install additional plugins,
+which may be inappropriate.
 
 # Upgrading
 
@@ -156,6 +216,18 @@
 
 As always - please ensure that you know how to drive docker - especially volume handling!
 
+# Building
+
+Build with the usual
+
+    docker build -t jenkins .
+
+Tests are written using [bats](https://github.com/sstephenson/bats) under the `tests` dir
+
+    bats tests
+
+Bats can be easily installed with `brew install bats` on OS X
+
 # Questions?
 
 Jump on irc.freenode.net and the #jenkins room. Ask!
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..5fe82ff
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,9 @@
+master:
+  build: .
+  environment:
+    JAVA_OPTS: "-Djava.awt.headless=true"
+  ports:
+    - "50000:50000"
+    - "8080:8080"
+  volumes:
+    - /var/jenkins_home
diff --git a/install-plugin.sh b/install-plugin.sh
new file mode 100755
index 0000000..aa39ca9
--- /dev/null
+++ b/install-plugin.sh
@@ -0,0 +1,49 @@
+#! /bin/sh
+
+function download() {
+	plugin=$1
+
+	if [[ ! -f ${plugin}.hpi ]]; then
+
+		url=http://updates.jenkins-ci.org/latest/${plugin}.hpi
+		echo "download plugin : $plugin from $url"
+
+		curl -s -f -L $url -o ${plugin}.hpi
+		if [[ $? -ne 0 ]]
+		then
+			>&2 echo "failed to download plugin ${plugin}"
+			exit -1
+		fi
+	else
+		echo "$plugin is allready downloaded."
+	fi	
+	resolveDependencies $1
+}
+
+function resolveDependencies() {	
+	plugin=$1
+
+	dependencies=`jrunscript -e 'java.lang.System.out.println(new java.util.jar.JarFile("'${plugin}.hpi'").getManifest().getMainAttributes().getValue("Plugin-Dependencies"));'`
+
+	if [[ "$dependencies" == "null" ]]; then
+		return
+	fi
+
+	echo " > depends on  ${dependencies}"
+
+	IFS=',' read -a array <<< "${dependencies}"
+
+    for d in "${array[@]}"
+	do
+		plugin=$(echo $d | cut -d':' -f1 -)
+		if [[ $d == *"resolution:=optional"* ]] 
+		then	
+			echo "skipping optional dependency $plugin"
+		else
+    		download $plugin
+		fi
+	done
+}
+
+
+download $1           
diff --git a/jenkins.sh b/jenkins.sh
index 97d7fcc..2fa42cd 100755
--- a/jenkins.sh
+++ b/jenkins.sh
@@ -2,34 +2,36 @@
 
 set -e
 
-# Copy files from /usr/share/jenkins/ref into /var/jenkins_home
-# So the initial JENKINS-HOME is set with expected content. 
-# Don't override, as this is just a reference setup, and use from UI 
+# Copy files from /usr/share/jenkins/ref into $JENKINS_HOME
+# So the initial JENKINS-HOME is set with expected content.
+# Don't override, as this is just a reference setup, and use from UI
 # can then change this, upgrade plugins, etc.
 copy_reference_file() {
-	f=${1%/} 
-	echo "$f" >> $COPY_REFERENCE_FILE_LOG
-    rel=${f:23}
-    dir=$(dirname ${f})
-    echo " $f -> $rel" >> $COPY_REFERENCE_FILE_LOG
-	if [[ ! -e /var/jenkins_home/${rel} ]] 
+	f="${1%/}"
+	b="${f%.override}"
+	echo "$f" >> "$COPY_REFERENCE_FILE_LOG"
+	rel="${b:23}"
+	dir=$(dirname "${b}")
+	echo " $f -> $rel" >> "$COPY_REFERENCE_FILE_LOG"
+	if [[ ! -e $JENKINS_HOME/${rel} || $f = *.override ]]
 	then
-		echo "copy $rel to JENKINS_HOME" >> $COPY_REFERENCE_FILE_LOG
-		mkdir -p /var/jenkins_home/${dir:23}
-		cp -r /usr/share/jenkins/ref/${rel} /var/jenkins_home/${rel};
+		echo "copy $rel to JENKINS_HOME" >> "$COPY_REFERENCE_FILE_LOG"
+		mkdir -p "$JENKINS_HOME/${dir:23}"
+		cp -r "${f}" "$JENKINS_HOME/${rel}";
 		# pin plugins on initial copy
-		[[ ${rel} == plugins/*.jpi ]] && touch /var/jenkins_home/${rel}.pinned
-	fi; 
+		[[ ${rel} == plugins/*.jpi ]] && touch "$JENKINS_HOME/${rel}.pinned"
+	fi;
 }
+: ${JENKINS_HOME:="/var/jenkins_home"}
 export -f copy_reference_file
-echo "--- Copying files at $(date)" >> $COPY_REFERENCE_FILE_LOG
+touch "${COPY_REFERENCE_FILE_LOG}" || (echo "Can not write to ${COPY_REFERENCE_FILE_LOG}. Wrong volume permissions?" && exit 1)
+echo "--- Copying files at $(date)" >> "$COPY_REFERENCE_FILE_LOG"
 find /usr/share/jenkins/ref/ -type f -exec bash -c "copy_reference_file '{}'" \;
 
 # if `docker run` first argument start with `--` the user is passing jenkins launcher arguments
 if [[ $# -lt 1 ]] || [[ "$1" == "--"* ]]; then
-   exec java $JAVA_OPTS -jar /usr/share/jenkins/jenkins.war $JENKINS_OPTS "$@"
+  eval "exec java $JAVA_OPTS -jar /usr/share/jenkins/jenkins.war $JENKINS_OPTS \"\$@\""
 fi
 
 # As argument is not jenkins, assume user want to run his own process, for sample a `bash` shell to explore this image
 exec "$@"
-
diff --git a/plugins.sh b/plugins.sh
index 3413ce4..ec8e8e5 100755
--- a/plugins.sh
+++ b/plugins.sh
@@ -24,4 +24,5 @@
       JENKINS_UC_DOWNLOAD=$JENKINS_UC/download
     fi
     curl -sSL -f ${JENKINS_UC_DOWNLOAD}/plugins/${plugin[0]}/${plugin[1]}/${plugin[0]}.hpi -o $REF/${plugin[0]}.jpi
+    unzip -qqt $REF/${plugin[0]}.jpi
 done  < $1
diff --git a/tests/plugins/Dockerfile b/tests/plugins/Dockerfile
new file mode 100644
index 0000000..c88c631
--- /dev/null
+++ b/tests/plugins/Dockerfile
@@ -0,0 +1,4 @@
+FROM bats-jenkins
+
+COPY plugins.txt /usr/share/jenkins/ref/
+RUN /usr/local/bin/plugins.sh /usr/share/jenkins/ref/plugins.txt
diff --git a/tests/plugins/plugins.txt b/tests/plugins/plugins.txt
new file mode 100644
index 0000000..712d603
--- /dev/null
+++ b/tests/plugins/plugins.txt
@@ -0,0 +1 @@
+maven-plugin:2.7.1
diff --git a/tests/test_helpers.bash b/tests/test_helpers.bash
new file mode 100644
index 0000000..63994f2
--- /dev/null
+++ b/tests/test_helpers.bash
@@ -0,0 +1,70 @@
+#!/bin/bash
+
+# check dependencies
+(
+    type docker &>/dev/null || ( echo "docker is not available"; exit 1 )
+    type curl &>/dev/null || ( echo "curl is not available"; exit 1 )
+)>&2
+
+# Assert that $1 is the outputof a command $2
+function assert {
+    local expected_output=$1
+    shift
+    local actual_output
+    actual_output=$("$@")
+    actual_output="${actual_output//[$'\t\r\n']}" # remove newlines
+    if ! [ "$actual_output" = "$expected_output" ]; then
+        echo "expected: \"$expected_output\""
+        echo "actual:   \"$actual_output\""
+        false
+    fi
+}
+
+# Retry a command $1 times until it succeeds. Wait $2 seconds between retries.
+function retry {
+    local attempts=$1
+    shift
+    local delay=$1
+    shift
+    local i
+
+    for ((i=0; i < attempts; i++)); do
+        run "$@"
+        if [ "$status" -eq 0 ]; then
+            return 0
+        fi
+        sleep $delay
+    done
+
+    echo "Command \"$*\" failed $attempts times. Status: $status. Output: $output" >&2
+    false
+}
+
+function get_jenkins_url {
+    if [ -z "${DOCKER_HOST}" ]; then
+        DOCKER_IP=localhost
+    else
+        DOCKER_IP=$(echo "$DOCKER_HOST" | sed -e 's|tcp://\(.*\):[0-9]*|\1|')
+    fi
+    echo "http://$DOCKER_IP:$(docker port "$SUT_CONTAINER" 8080 | cut -d: -f2)"
+}
+
+function get_jenkins_password {
+    docker logs "$SUT_CONTAINER" 2>&1 | grep -A 2 "Please use the following password to proceed to installation" | tail -n 1
+}
+
+function test_url {
+    run curl --user "admin:$(get_jenkins_password)" --output /dev/null --silent --head --fail --connect-timeout 30 --max-time 60 "$(get_jenkins_url)$1"
+    if [ "$status" -eq 0 ]; then
+        true
+    else
+        echo "URL $(get_jenkins_url)$1 failed" >&2
+        echo "output: $output" >&2
+        false
+    fi
+}
+
+function cleanup {
+    docker kill "$1" &>/dev/null ||:
+    docker rm -fv "$1" &>/dev/null ||:
+}
diff --git a/tests/tests.bats b/tests/tests.bats
new file mode 100644
index 0000000..01f42fe
--- /dev/null
+++ b/tests/tests.bats
@@ -0,0 +1,59 @@
+#!/usr/bin/env bats
+
+SUT_IMAGE=bats-jenkins
+SUT_CONTAINER=bats-jenkins
+
+load test_helpers
+
+@test "build image" {
+  cd $BATS_TEST_DIRNAME/..
+  docker build -t $SUT_IMAGE .
+}
+
+@test "clean test containers" {
+    cleanup $SUT_CONTAINER
+}
+
+@test "test multiple JENKINS_OPTS" {
+  # running --help --version should return the version, not the help
+  local version=$(grep 'ENV JENKINS_VERSION' Dockerfile | sed -e 's/.*:-\(.*\)}/\1/')
+  # need the last line of output
+  assert "${version}" docker run --rm -ti -e JENKINS_OPTS="--help --version" --name $SUT_CONTAINER -P $SUT_IMAGE | tail -n 1
+}
+
+@test "test jenkins arguments" {
+  # running --help --version should return the version, not the help
+  local version=$(grep 'ENV JENKINS_VERSION' Dockerfile | sed -e 's/.*:-\(.*\)}/\1/')
+  # need the last line of output
+  assert "${version}" docker run --rm -ti --name $SUT_CONTAINER -P $SUT_IMAGE --help --version | tail -n 1
+}
+
+@test "create test container" {
+    docker run -d -e JAVA_OPTS="-Duser.timezone=Europe/Madrid -Dhudson.model.DirectoryBrowserSupport.CSP=\"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline';\"" --name $SUT_CONTAINER -P $SUT_IMAGE
+}
+
+@test "test container is running" {
+  sleep 1  # give time to eventually fail to initialize
+  retry 3 1 assert "true" docker inspect -f {{.State.Running}} $SUT_CONTAINER
+}
+
+@test "Jenkins is initialized" {
+    retry 30 5 test_url /api/json
+}
+
+@test "JAVA_OPTS are set" {
+    local sed_expr='s/<wbr>//g;s/<td class="pane">.*<\/td><td class.*normal">//g;s/<t.>//g;s/<\/t.>//g'
+    assert 'default-src &#039;self&#039;; script-src &#039;self&#039; &#039;unsafe-inline&#039; &#039;unsafe-eval&#039;; style-src &#039;self&#039; &#039;unsafe-inline&#039;;' \
+      bash -c "curl -fsSL --user \"admin:$(get_jenkins_password)\" $(get_jenkins_url)/systemInfo | sed 's/<\/tr>/<\/tr>\'$'\n/g' | grep '<td class=\"pane\">hudson.model.DirectoryBrowserSupport.CSP</td>' | sed -e '${sed_expr}'"
+    assert 'Europe/Madrid' \
+      bash -c "curl -fsSL --user \"admin:$(get_jenkins_password)\" $(get_jenkins_url)/systemInfo | sed 's/<\/tr>/<\/tr>\'$'\n/g' | grep '<td class=\"pane\">user.timezone</td>' | sed -e '${sed_expr}'"
+}
+
+@test "plugins are installed" {
+  docker build -t $SUT_IMAGE-plugins $BATS_TEST_DIRNAME/plugins
+  assert "maven-plugin.jpi maven-plugin.jpi.pinned" docker run -ti --rm $SUT_IMAGE-plugins ls /var/jenkins_home/plugins | sed -e 's/  / /'
+}
+
+@test "clean test containers" {
+    cleanup $SUT_CONTAINER
+}