2017-02-13 19:01:54 +00:00
|
|
|
#!/usr/bin/env bash
|
2014-12-19 07:20:59 +00:00
|
|
|
|
2018-12-22 19:18:33 +00:00
|
|
|
if [[ ! "$(go env GOOS)" = 'windows' ]]; then
|
2016-01-05 18:52:59 +00:00
|
|
|
for pidFile in $(find "$DEST" -name docker.pid); do
|
2018-12-22 19:18:33 +00:00
|
|
|
pid=$([[ -n "$TESTDEBUG" ]] && set -x; cat "$pidFile")
|
2017-07-06 21:20:41 +00:00
|
|
|
(
|
2018-12-22 19:18:33 +00:00
|
|
|
[[ -n "$TESTDEBUG" ]] && set -x
|
2017-07-06 21:20:41 +00:00
|
|
|
kill "$pid"
|
|
|
|
)
|
2016-01-05 18:52:59 +00:00
|
|
|
if ! wait "$pid"; then
|
|
|
|
echo >&2 "warning: PID $pid from $pidFile had a nonzero exit code"
|
|
|
|
fi
|
|
|
|
done
|
2015-05-04 20:20:01 +00:00
|
|
|
|
2018-12-22 19:18:33 +00:00
|
|
|
if [[ -z "$DOCKER_TEST_HOST" ]]; then
|
2016-01-05 18:52:59 +00:00
|
|
|
# Stop apparmor if it is enabled
|
2018-12-22 19:18:33 +00:00
|
|
|
if [[ -e "/sys/module/apparmor/parameters/enabled" ]] && [[ "$(cat /sys/module/apparmor/parameters/enabled)" == "Y" ]]; then
|
2016-01-05 18:52:59 +00:00
|
|
|
(
|
2018-12-22 19:18:33 +00:00
|
|
|
[[ -n "$TESTDEBUG" ]] && set -x
|
2016-01-05 18:52:59 +00:00
|
|
|
/etc/init.d/apparmor stop
|
|
|
|
)
|
|
|
|
fi
|
2015-05-04 20:20:01 +00:00
|
|
|
fi
|
2016-01-05 18:52:59 +00: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 20:20:01 +00:00
|
|
|
fi
|