2 # This script is used for testing install.sh and that it works for
3 # each of component of our apt and yum repos
6 : ${DEB_DIR:="$(pwd)/bundles/$(cat VERSION)/build-deb"}
8 if [[ ! -d "${DEB_DIR}" ]]; then
9 echo "you must first run `make deb` or hack/make/build-deb"
14 # test for each Dockerfile in contrib/builder
16 builderDir="contrib/builder/deb/${PACKAGE_ARCH}"
17 pkgs=( $(find "${builderDir}/"*/ -type d) )
18 if [ ! -z "$DOCKER_BUILD_PKGS" ]; then
20 for p in $DOCKER_BUILD_PKGS; do
21 pkgs+=( "$builderDir/$p" )
24 for dir in "${pkgs[@]}"; do
25 [ -d "$dir" ] || { echo >&2 "skipping nonexistent $dir"; continue; }
26 local from="$(awk 'toupper($1) == "FROM" { print $2; exit }' "$dir/Dockerfile")"
27 local dir=$(basename "$dir")
29 if [[ ! -d "${DEB_DIR}/${dir}" ]]; then
30 echo "No deb found for ${dir}"
34 local script=$(mktemp /tmp/install-XXXXXXXXXX.sh)
35 cat <<-EOF > "${script}"
40 apt-get update && apt-get install -y apparmor
42 dpkg -i /root/debs/*.deb || true
46 /etc/init.d/apparmor start
48 # this will do everything _except_ load the profile into the kernel
51 /sbin/apparmor_parser --skip-kernel-load docker-engine
57 echo "testing deb install for ${from}"
58 docker run --rm -i --privileged \
59 -v ${DEB_DIR}/${dir}:/root/debs \
60 -v ${script}:/install.sh \
68 bundle .integration-daemon-start
70 bundle .integration-daemon-stop
71 ) 2>&1 | tee -a "$DEST/test.log"