File: integration

package info (click to toggle)
docker.io 28.5.2%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 69,048 kB
  • sloc: sh: 5,867; makefile: 863; ansic: 184; python: 162; asm: 159
file content (41 lines) | stat: -rwxr-xr-x 1,051 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
set -eux

# apply patches
dpkg-source --before-build .

# prepare the environment
./debian/rules dh_configure
export GOPATH="$PWD/_build"
export DOCKER_GITCOMMIT="$(./debian/helpers/gitcommit.sh)"

# docker's tests need an unprivileged user available at this username
useradd --system --gid docker --comment 'Docker Test Suite Unprivileged User' unprivilegeduser

# https://github.com/docker/docker/blob/7307998a44237a8943792c279b81ff5a387a86fa/builder/dockerfile/builder.go#L34-L44
proxyArgs=(
	http_proxy
	https_proxy
	ftp_proxy
	no_proxy
)
DOCKER_BUILD_ARGS=
for proxyArgBase in "${proxyArgs[@]}"; do
	for proxyArg in "${proxyArgBase^^}" "$proxyArgBase"; do
		if [ -n "${!proxyArg}" ]; then
			[ -z "$DOCKER_BUILD_ARGS" ] || DOCKER_BUILD_ARGS+=' '
			DOCKER_BUILD_ARGS+="--build-arg ${proxyArg}=${!proxyArg}"
		fi
	done
done
export DOCKER_BUILD_ARGS

# run the tests
./hack/make.sh test-integration-cli

# clean up cruft we've created
./debian/rules clean
userdel --force unprivilegeduser

# unapply patches
dpkg-source --after-build .