From 1ceefdadae35679ce3566fe9195a11bd0877ff54 Mon Sep 17 00:00:00 2001 From: Balint Reczey Date: Fri, 12 May 2017 10:10:28 +0200 Subject: [PATCH 1/3] Add basic autopkgtest --- debian/tests/control | 3 ++ debian/tests/default-bootstraps | 95 +++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 debian/tests/control create mode 100755 debian/tests/default-bootstraps diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 00000000..a37a5d79 --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,3 @@ +Tests: default-bootstraps +Depends: @, lsb-release +Restrictions: needs-root diff --git a/debian/tests/default-bootstraps b/debian/tests/default-bootstraps new file mode 100755 index 00000000..105c35c2 --- /dev/null +++ b/debian/tests/default-bootstraps @@ -0,0 +1,95 @@ +#!/bin/sh +# autopkgtest check: Build default rootfs for all supported project:subproject pairs +# (C) 2017 Canonical Ltd. +# Author: Balint Reczey + +set -e + +if [ -z "$SUITE"]; then + SUITE=$(lsb_release -c -s) +fi + +# Known project:subproject:template combinations. +# Listed subprojects can be combined with other projects as well, +# but this list gives reasonable coverage. +ALL_TRIPLETS=" + base:: + edubuntu:: + edubuntu-dvd:: + kubuntu:: + kubuntu-active:: + kubuntu-dvd:: + kubuntu-plasma5:: + lubuntu:: + lubuntu-next:: + mythbuntu:: + ubuntu:: + ubuntu-base:: + ubuntu-budgie:: + ubuntu-budgie-desktop:: + ubuntu-budgie-live:: + ubuntu-core:system-image:ubuntu-core + ubuntu-desktop-next:system-image:ubuntu-desktop-next + ubuntu-desktop-next::ubuntu-desktop-next + ubuntu-dvd:: + ubuntu-gnome:: + ubuntukylin:: + ubuntu-mate:: + ubuntu-mate-core:: + ubuntu-mate-desktop:: + ubuntu-mate-live:: + ubuntu-netbook:: + ubuntu-server:: + ubuntu-server:ubuntu-rtm: + ubuntu-server:ubuntu-rtm/foo: + ubuntu-server:wubi: + ubuntu-touch-custom::ubuntu-touch-custom + ubuntu-touch::ubuntu-touch + xubuntu::" + +if [ -z "$SELECTED_TRIPLETS" ]; then + SELECTED_TRIPLETS=" + ubuntu-base:: +" +fi + +live_build_rootfs() { + PROJECT=${1%%:*} + local SUBPROJECT_TMP=${1%:*} + SUBPROJECT=${SUBPROJECT_TMP#*:} + TEMPLATE=${1##*:} + ARCH=$(dpkg --print-architecture) + echo "Building rootfs for project: '$PROJECT' subproject: '$SUBPROJECT' template: '$TEMPLATE' in $PWD" + cp -a /usr/share/livecd-rootfs/live-build/auto . + if [ -n "$TEMPLATE" ]; then + cp -a /usr/share/livecd-rootfs/live-build/$TEMPLATE . + fi + (env PROJECT=$PROJECT \ + SUBPROJECT=$SUBPROJECT \ + SUITE=$SUITE \ + ARCH=$ARCH \ + lb config + ) + mkdir chroot + # this part needs root rights, but right now the whole script ran as root by autopkgtest + (env PROJECT=$PROJECT \ + SUBPROJECT=$SUBPROJECT \ + ARCH=$ARCH \ + lb build + ) + echo "Build results for project: '$PROJECT' subproject: '$SUBPROJECT' template: '$TEMPLATE' in $PWD" + du -sh * + echo "" +} + +WORKDIR=$(mktemp -d) +trap "RET=\$?; rm -rf $WORKDIR; exit \$RET" 0 INT QUIT ABRT PIPE TERM +cd $WORKDIR + +for i in $SELECTED_TRIPLETS; do + mkdir $i + (cd $i && live_build_rootfs $i) + # clean up after build to avoid filling the disk, needs root rights + rm -rf $i +done + From b94b8db726aa4fa10bada1da0f01557469eda105 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Fri, 12 May 2017 10:10:31 +0200 Subject: [PATCH 2/3] Mark autopkgtests isolation-machine since debootstrap won't work in a container. --- debian/tests/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/tests/control b/debian/tests/control index a37a5d79..b40640f9 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -1,3 +1,3 @@ Tests: default-bootstraps Depends: @, lsb-release -Restrictions: needs-root +Restrictions: needs-root isolation-machine From 85b7e46d5914fa1433dfb5c6b3bc3885b153f90f Mon Sep 17 00:00:00 2001 From: Balint Reczey Date: Fri, 12 May 2017 10:54:21 +0200 Subject: [PATCH 3/3] Update changelog --- debian/changelog | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/debian/changelog b/debian/changelog index 59047bd7..7175f88a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +livecd-rootfs (2.208.14) UNRELEASED; urgency=medium + + [ Balint Reczey ] + * Add basic but configurable autopkgtest + + [ Steve Langasek ] + * Mark autopkgtests isolation-machine since debootstrap won't work in a container. + (LP: #1684090) + + -- Balint Reczey Thu, 11 May 2017 16:18:20 +0200 + livecd-rootfs (2.208.13) trusty; urgency=medium * live-build/auto/config: Switch HWE from wily to xenial (LP: #1568918)