Browse Source

Merge branch 'suites/jessie' into 'master'

Suites/jessie

Updates  B20autopkgtest for package binary tests

See merge request !76
tags/devuan/0.15.2+devuan4
Daniel Reurich 6 years ago
parent
commit
992a204733
2 changed files with 73 additions and 30 deletions
  1. +6
    -0
      debian/changelog
  2. +67
    -30
      pbuilder-hookdir/B20autopkgtest

+ 6
- 0
debian/changelog View File

@@ -1,3 +1,9 @@
jenkins-debian-glue (0.14.1+devuan6) unstable; urgency=low

* copy updated B20autopkgtest from pbuilder/examples

-- Daniel Reurich <centurion@zephaniah.centurion.net.nz> Sat, 28 Nov 2015 08:19:42 +1300

jenkins-debian-glue (0.14.1+devuan5) unstable; urgency=medium

* Import latest changes from upstream


+ 67
- 30
pbuilder-hookdir/B20autopkgtest View File

@@ -1,57 +1,94 @@
#!/bin/sh
# Copyright 2013 Michael Prokop <mika@debian.org>
# Copyright 2012 Christoph Berg <myon@debian.org>
# Licensed under the terms of the MIT License.
# Copyright © 2012 Christoph Berg <myon@debian.org>
# © 2013 Michael Prokop <mika@debian.org>
# © 2015 Mattia Rizzolo <mattia@mapreri.org>
#
# This file is part of pbuilder -- personal Debian package builder
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA


BUILDDIR="${BUILDDIR:-/tmp/buildd}"

if [ "${ADT:-}" = "skip" ]; then
echo "Skipping autopkgtests as requested (ADT is set to 'skip')"
exit 0
echo "Skipping autopkgtests as requested (ADT is set to 'skip')"
exit 0
fi

if [ "${ADT:-}" = "external" ]; then
echo "Skipping internal autopkgtests as external testing was requested via ADT variable"
exit 0
echo "Skipping internal autopkgtests as external testing was requested via ADT variable"
exit 0
fi

set -ex

cd /tmp/buildd/*/debian/..
cd "$BUILDDIR"/*/debian/..

if [ ! -f debian/tests/control ]; then
echo "Package does not have autopkgtest support, debian/tests/control is missing"
exit 0
echo "Package does not have autopkgtest support, debian/tests/control is missing"
exit 0
fi

if [ ! -f debian/files ]; then
echo "Package source is not built, debian/files is missing" >&2
exit 1
echo "Package source is not built, debian/files is missing" >&2
exit 1
fi

if [ -n "${ADT_OPTIONS:-}" ] ; then
echo "*** Using provided ADT_OPTIONS $ADT_OPTIONS ***"
echo "*** Using provided ADT_OPTIONS $ADT_OPTIONS ***"
fi

set -- /tmp/adt-*/
TMPADT="$1"
if [ ! -d "$TMPADT" ]; then
echo "Didn't find any /tmp/adt-*/ directory. It should have been created before invoking cowbuilder." >&2
ls -la /tmp
exit 1
# try to launch adt-run in a new PID namespace so several testsuites can run
# in parallel, newpid exists in jessie and newer only though
unset newpid_name
if ! apt-cache policy newpid | grep -q 'newpid:' ; then
echo "The newpid package doesn't seem to be available, not considering for installation"
else
echo "The newpid package seems to be available, considering for installation"
newpid_name='newpid'
fi

# runner/adt-run uses apt-utils's apt-ftparchive and
# pbuilder's pbuilder-satisfydepends-classic
apt-get install -y autopkgtest apt-utils pbuilder
apt-get install -y autopkgtest apt-utils pbuilder $newpid_name

# since autopkgtest 3.16 the --tmp-dir option is gone, make sure
# we've --output-dir available though before using it
if adt-run --help | grep -q -- --output-dir 2>/dev/null ; then
OUTPUT_OPTION='--output-dir'
else
OUTPUT_OPTION='--tmp-dir'
fi

mkdir -p "$BUILDDIR/autopkgtest.out"

mkdir -p "$TMPADT/out"
binaries=$(awk '/\.deb / { print "--binary ../" $1 }' debian/files)
$newpid_name adt-run \
${OUTPUT_OPTION} "$BUILDDIR/autopkgtest.out" \
--summary "$BUILDDIR/autopkgtest.summary" \
"$BUILDDIR"/*.deb \
--built-tree "${PWD}" \
${ADT_OPTIONS:-} --- adt-virt-null || EXIT=$?

adt-run \
--tmp-dir "${TMPADT}/out" \
--summary "${TMPADT}/summary" \
--built-tree "${PWD}" \
$binaries ${ADT_OPTIONS:-} --- adt-virt-null || EXIT=$?
# collect autopkgtest output in a single file so pbuilder automatically copies it
tar -caf "$BUILDDIR/autopkgtest.tar.gz" "$BUILDDIR/autopkgtest.out"

# 4 means some test failed, exit 0 here and let adtsummary_tap report the failure
[ ${EXIT:-0} = 4 ] && exit 0
exit ${EXIT:-0}
case ${EXIT:-0} in
2|4|6|8) # let adtsummary_tap report the failure
exit 0
;;
*)
exit ${EXIT:-0}
;;
esac

Loading…
Cancel
Save