2017-02-13 14:01:54 -05:00
|
|
|
#!/usr/bin/env bash
|
2014-12-19 02:20:59 -05:00
|
|
|
|
2016-01-05 13:52:59 -05:00
|
|
|
if [ ! "$(go env GOOS)" = 'windows' ]; then
|
|
|
|
for pidFile in $(find "$DEST" -name docker.pid); do
|
2017-07-06 17:20:41 -04:00
|
|
|
pid=$([ -n "$TESTDEBUG" ] && set -x; cat "$pidFile")
|
|
|
|
(
|
|
|
|
[ -n "$TESTDEBUG" ] && set -x
|
|
|
|
kill "$pid"
|
|
|
|
)
|
2016-01-05 13:52:59 -05:00
|
|
|
if ! wait "$pid"; then
|
|
|
|
echo >&2 "warning: PID $pid from $pidFile had a nonzero exit code"
|
|
|
|
fi
|
|
|
|
done
|
2015-05-04 16:20:01 -04:00
|
|
|
|
2016-01-05 13:52:59 -05:00
|
|
|
if [ -z "$DOCKER_TEST_HOST" ]; then
|
|
|
|
# Stop apparmor if it is enabled
|
|
|
|
if [ -e "/sys/module/apparmor/parameters/enabled" ] && [ "$(cat /sys/module/apparmor/parameters/enabled)" == "Y" ]; then
|
|
|
|
(
|
2017-07-06 17:20:41 -04:00
|
|
|
[ -n "$TESTDEBUG" ] && set -x
|
2016-01-05 13:52:59 -05:00
|
|
|
/etc/init.d/apparmor stop
|
|
|
|
)
|
|
|
|
fi
|
2015-05-04 16:20:01 -04:00
|
|
|
fi
|
2016-01-05 13:52:59 -05:00
|
|
|
else
|
|
|
|
# Note this script is not actionable on Windows to Linux CI. Instead the
|
|
|
|
# DIND daemon under test is torn down by the Jenkins tear-down script
|
|
|
|
echo "INFO: Not stopping daemon on Windows CI"
|
2015-05-04 16:20:01 -04:00
|
|
|
fi
|