Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/lib: abstract build dependency installation a bit more #3357

Merged
merged 7 commits into from May 23, 2017
11 changes: 11 additions & 0 deletions tests/lib/distro.sh
@@ -0,0 +1,11 @@
#!/bin/sh

DISTRO_BUILD_DEPS=""

case "$SPREAD_SYSTEM" in
debian-*|ubuntu-*)
DISTRO_BUILD_DEPS="build-essential curl devscripts expect gdebi-core jq rng-tools git netcat-openbsd"
;;
*)
;;
esac
23 changes: 15 additions & 8 deletions tests/lib/prepare-project.sh
Expand Up @@ -121,14 +121,21 @@ if [[ "$SPREAD_SYSTEM" == ubuntu-14.04-* ]]; then
quiet apt-get install -y --force-yes apparmor libapparmor1 seccomp libseccomp2 systemd cgroup-lite util-linux
fi

distro_purge_package snapd
# utilities
# XXX: build-essential seems to be required. Otherwise package build
# fails with unmet dependency on "build-essential:native"
distro_install_package build-essential curl devscripts expect gdebi-core jq rng-tools git netcat-openbsd

# in 16.04: apt build-dep -y ./
quiet apt-get install -y $(gdebi --quiet --apt-line ./debian/control)
. "$TESTSLIB/distro.sh"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a nice abstraction. However I wonder if it would be better to move this into pkgdb.sh as this is currently the central place of knowledge about pkg names on various distros.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, let me do that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


distro_purge_package snapd || true
distro_install_package $DISTRO_BUILD_DEPS

# We take a special case for Debian/Ubuntu where we install additional build deps
# base on the packaging. In Fedora/Suse this is handled via mock/osc
case "$SPREAD_SYSTEM" in
debian-*|ubuntu-*)
# in 16.04: apt build-dep -y ./
quiet apt-get install -y $(gdebi --quiet --apt-line ./debian/control)
;;
*)
;;
esac

# update vendoring
if [ "$(which govendor)" = "" ]; then
Expand Down