/usr/share/jenkins-debian-glue/pbuilder-hookdir/B20autopkgtest is in jenkins-debian-glue 0.18.4.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | #!/bin/sh
# Copyright 2013 Michael Prokop <mika@debian.org>
# Copyright 2012 Christoph Berg <myon@debian.org>
# Licensed under the terms of the MIT License.
if [ "${ADT:-}" = "skip" ]; then
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
fi
set -ex
cd /tmp/buildd/*/debian/..
if [ ! -f debian/tests/control ]; then
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
fi
if [ -n "${ADT_OPTIONS:-}" ] ; then
echo "*** Using provided ADT_OPTIONS $ADT_OPTIONS ***"
fi
# 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 $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 /tmp/buildd/autopkgtest.out
$newpid_name adt-run \
${OUTPUT_OPTION} /tmp/buildd/autopkgtest.out \
--summary /tmp/buildd/autopkgtest.summary \
/tmp/buildd/*.deb \
--built-tree "${PWD}" \
${ADT_OPTIONS:-} --- adt-virt-null || EXIT=$?
# collect autopkgtest output in a single file so pbuilder automatically copies it
tar acf /tmp/buildd/autopkgtest.tar.gz /tmp/buildd/autopkgtest.out
case ${EXIT:-0} in
2|4|6|8) # let adtsummary_tap report the failure
exit 0
;;
*)
exit ${EXIT:-0}
;;
esac
|