| 1 | #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash |
| 2 | |
| 3 | if [scip-shell system . . `[`. ! "$(goscip-shell system . . go. env GOOS)" = 'windows' ]; then |
| 4 | for pidFile in $(findscip-shell system . . find. "$DEST" -name docker.pid); do |
| 5 | pid=$( |
| 6 | [scip-shell system . . `[`. -n "$TESTDEBUG" ] && set -x |
| 7 | catscip-shell system . . cat. "$pidFile" |
| 8 | ) |
| 9 | ( |
| 10 | [scip-shell system . . `[`. -n "$TESTDEBUG" ] && set -x |
| 11 | killscip-shell system . . kill. "$pid" |
| 12 | ) |
| 13 | if ! wait "$pid"; then |
| 14 | echoscip-shell system . . echo. >&2 "warning: PID $pid from $pidFile had a nonzero exit code" |
| 15 | fi |
| 16 | root=$(dirnamescip-shell system . . dirname. "$pidFile")/root |
| 17 | if [scip-shell system . . `[`. -d "$root" ]; then |
| 18 | umountscip-shell system . . umount. -q "$root" || truescip-shell system . . true. |
| 19 | fi |
| 20 | done |
| 21 | |
| 22 | if [scip-shell system . . `[`. -z "$DOCKER_TEST_HOST" ]; then |
| 23 | # Stop apparmor if it is enabled |
| 24 | if [scip-shell system . . `[`. -e "/sys/module/apparmor/parameters/enabledscip-shell filesystem . . `/sys/module/apparmor/parameters/enabled`." ] && [scip-shell system . . `[`. "$(catscip-shell system . . cat. /sys/module/apparmor/parameters/enabledscip-shell filesystem . . `/sys/module/apparmor/parameters/enabled`.)" == "Y" ]; then |
| 25 | ( |
| 26 | [scip-shell system . . `[`. -n "$TESTDEBUG" ] && set -x |
| 27 | /etc/init.d/apparmorscip-shell filesystem . . `/etc/init.d/apparmor`. stop || truescip-shell system . . true. |
| 28 | ) |
| 29 | fi |
| 30 | fi |
| 31 | else |
| 32 | # Note this script is not actionable on Windows to Linux CI. Instead the |
| 33 | # DIND daemon under test is torn down by the Jenkins tear-down script |
| 34 | echoscip-shell system . . echo. "INFO: Not stopping daemon on Windows CI" |
| 35 | fi |