diff -Nru autopkgtest-2.9.2/debian/changelog autopkgtest-2.10/debian/changelog --- autopkgtest-2.9.2/debian/changelog 2014-03-12 07:13:55.000000000 +0000 +++ autopkgtest-2.10/debian/changelog 2014-03-18 15:12:30.000000000 +0000 @@ -1,3 +1,15 @@ +autopkgtest (2.10) unstable; urgency=medium + + * Record name and version of tested package in log and in + output-dir/testpkg-version. (first part of LP #1292431) + * Record installed packages and their versions for each test, in + /-packages. (second half of LP: #1292431) + * Drop adt-testreport-*, adt-openbugs-*: These have been marked deprecated + for a while, haven't been used or maintained in many years, and are + superseded by jenkins/debci. (Closes: #695974) + + -- Martin Pitt Tue, 18 Mar 2014 16:12:24 +0100 + autopkgtest (2.9.2) unstable; urgency=medium * VirtSubproc.py, copydown_shareddir(): Fix "src and dest are the same file" diff -Nru autopkgtest-2.9.2/debian/control autopkgtest-2.10/debian/control --- autopkgtest-2.9.2/debian/control 2014-03-12 07:13:55.000000000 +0000 +++ autopkgtest-2.10/debian/control 2014-03-18 15:12:30.000000000 +0000 @@ -35,7 +35,7 @@ Package: autopkgtest-xenlvm Architecture: all Depends: libadns1-bin, chiark-utils-bin, iproute, dmsetup, ${misc:Depends} -Recommends: lvm2, debootstrap, curl +Recommends: lvm2, debootstrap Suggests: autopkgtest Replaces: autopkgtest (<< 2.5.3~) Breaks: autopkgtest (<< 2.5.3~) @@ -48,5 +48,3 @@ You will need a working Xen setup to make use of this software. Your network administrator will need to provide support for the testbeds' networking requirements. See the README for documentation. - . - Use of the pre-cooked adt-testreport-onepackage script requires curl. diff -Nru autopkgtest-2.9.2/runner/adt-run autopkgtest-2.10/runner/adt-run --- autopkgtest-2.9.2/runner/adt-run 2014-03-12 07:13:55.000000000 +0000 +++ autopkgtest-2.10/runner/adt-run 2014-03-18 15:12:30.000000000 +0000 @@ -1161,6 +1161,21 @@ def run_tests(stanzas, tree): global errorcode, testbed + + # record tested package version + with open(os.path.join(tree.host, 'debian', 'changelog')) as f: + m = re.match('^([^ ]+) \(([^ ]+)\) ', f.readline()) + if m: + debug('testing package %s version %s' % (m.group(1), m.group(2))) + if opts.output_dir: + with open(os.path.join(tmp, 'testpkg-version'), 'w') as f: + f.write(m.group(1)) + f.write(' ') + f.write(m.group(2)) + f.write('\n') + else: + error('debian/changelog is invalid, cannot parse version') + if stanzas == (): report('*', 'SKIP no tests in this package') errorcode |= 8 @@ -1229,6 +1244,16 @@ testbed.prepare(dn) def run(self, tree): + # record installed package versions + if opts.output_dir: + pkglist = TempTestbedPath(testbed, self.what + '-packages', autoclean=False) + rc = testbed.execute( + 'record-pkgversions-' + self.what, + ['sh', '-ec', "dpkg-query --show -f '${Package}\\t${Version}\\n' > %s" % pkglist.tb]) + if rc: + bomb('failed to get package list') + pkglist.copyup() + # ensure our tests are in the testbed tree.copydown() diff -Nru autopkgtest-2.9.2/tests/adt-run autopkgtest-2.10/tests/adt-run --- autopkgtest-2.9.2/tests/adt-run 2014-03-12 07:13:55.000000000 +0000 +++ autopkgtest-2.10/tests/adt-run 2014-03-18 15:12:30.000000000 +0000 @@ -339,6 +339,9 @@ # should not have any test stderr self.assertNotIn('stderr', err) + # should log package version + self.assertIn('adt-run: testing package testpkg version 1\n', err) + def test_dsc_build_needed_success(self): '''dsc, build-needed restriction, test success''' @@ -460,11 +463,27 @@ self.assertIn('dh build', contents) self.assertRegex(contents, 'ubtree0t-sF\s+FAIL status: 0, stderr: kaputt') self.assertIn('@@@@ tests done', contents) + self.assertIn('testing package testpkg version 1\n', contents) + + # check test package version + with open(os.path.join(outdir, 'testpkg-version')) as f: + contents = f.read() + self.assertEqual(contents, 'testpkg 1\n') + + # check recorded package list + for t in ['sP', 'sF', 'bP']: + with open(os.path.join(outdir, 'ubtree0t-%s-packages' % t)) as f: + lines = f.read().splitlines() + self.assertGreater(len(lines), 10) + self.assertRegex(lines[0], '^[0-9a-z.-]+\t[0-9a-z.~-]+') + self.assertRegex(lines[1], '^[0-9a-z.-]+\t[0-9a-z.~-]+') # check for cruft in outdir # --no-built-binaries, we don't expect any debs - files = [i for i in os.listdir(outdir) if not fnmatch.fnmatch(i, 'ubtree*-std*')] - self.assertEqual(set(files), set(['log'])) + files = [i for i in os.listdir(outdir) + if not fnmatch.fnmatch(i, 'ubtree*-std*') and + not fnmatch.fnmatch(i, 'ubtree*-packages')] + self.assertEqual(set(files), set(['log', 'testpkg-version'])) def test_timeout(self): '''handling test timeout''' @@ -736,7 +755,7 @@ install_elf('/usr/bin/awk') # some fakes - for cmd in ['dpkg', 'apt-get', 'apt-key', 'apt-cache']: + for cmd in ['dpkg', 'dpkg-query', 'apt-get', 'apt-key', 'apt-cache']: p = os.path.join(self.chroot, 'usr', 'bin', cmd) with open(p, 'w') as f: f.write('#!/bin/sh\necho "fake-%s: $@" >&2\n' % cmd) @@ -771,6 +790,9 @@ self.assertNotIn('@@@@@@ test bed setup', err) + # should log package version + self.assertIn('adt-run: testing package testpkg version 1\n', err) + def test_tree_norestrictions_nobuild_fail_on_exit(self): '''source tree, no build, no restrictions, test fails with non-zero''' @@ -945,8 +967,10 @@ self.assertRegex(out, 'tree0t-a4\s+PASS', out) # check for cruft in output dir - files = [f for f in os.listdir(outdir) if not fnmatch.fnmatch(f, 'ubtree*-std*')] - self.assertEqual(set(files), set(['log', 'artifacts'])) + files = [i for i in os.listdir(outdir) + if not fnmatch.fnmatch(i, 'ubtree*-std*') and + not fnmatch.fnmatch(i, 'ubtree*-packages')] + self.assertEqual(set(files), set(['log', 'artifacts', 'testpkg-version'])) # check artifact; a2 should overwrite a1's health.txt with open(os.path.join(outdir, 'artifacts', 'health.txt')) as f: @@ -1467,6 +1491,19 @@ self.assertRegex(contents, 'ubtree0t-broken\s+FAIL status: 0, stderr: kaputt') self.assertIn('@@@@ tests done', contents) + # check test package version + with open(os.path.join(outdir, 'testpkg-version')) as f: + contents = f.read() + self.assertEqual(contents, 'testpkg 1\n') + + # check recorded package list + for t in ['ok', 'broken']: + with open(os.path.join(outdir, 'ubtree0t-%s-packages' % t)) as f: + lines = f.read().splitlines() + self.assertGreater(len(lines), 10) + self.assertRegex(lines[0], '^[0-9a-z.-]+\t[0-9a-z.~-]+') + self.assertRegex(lines[1], '^[0-9a-z.-]+\t[0-9a-z.~-]+') + # check binaries bins = os.listdir(os.path.join(outdir, 'binaries')) self.assertEqual(set(bins), @@ -1474,8 +1511,10 @@ 'Packages.gz', 'Packages', 'testpkg.deb'])) # check for cruft in outdir - files = [i for i in os.listdir(outdir) if not fnmatch.fnmatch(i, 'ubtree*-std*')] - self.assertEqual(set(files), set(['log', 'binaries'])) + files = [i for i in os.listdir(outdir) + if not fnmatch.fnmatch(i, 'ubtree*-std*') and + not fnmatch.fnmatch(i, 'ubtree*-packages')] + self.assertEqual(set(files), set(['log', 'binaries', 'testpkg-version'])) def test_user(self): '''--user option''' diff -Nru autopkgtest-2.9.2/xen/adt-openbugs-fetch-debbugs autopkgtest-2.10/xen/adt-openbugs-fetch-debbugs --- autopkgtest-2.9.2/xen/adt-openbugs-fetch-debbugs 2014-03-12 07:13:55.000000000 +0000 +++ autopkgtest-2.10/xen/adt-openbugs-fetch-debbugs 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -#!/usr/bin/perl - -use warnings; -use strict; -use Data::Dumper; -use SOAP::Lite; - -print STDERR "The adt-openbugs-* scripts are unmaintained and deprecated in favor of\n"; -print STDERR "http://ci.debian.net, debci, and/or jenkins. They will go away soon if\n"; -print STDERR "nobody uses them any more; so if you still do, please mail\n"; -print STDERR "autopkgtest-devel\@lists.alioth.debian.org. Thanks!\n"; - -die if @ARGV; - -sub e ($) { - my ($v) = @_; - $v= ''.$v; - my $r= $ENV{$v}; - die "need $v in environment" unless defined $r; - return $r; -} - -my $dist= e('distro'); -my $debbugs_soap= e('openbugs_debbugs_soap'); -my $debbugs_uri= e('openbugs_debbugs_uri'); -my $usertag_owner= e('openbugs_usertag_owner'); -my $usertag_name= e('openbugs_usertag_name'); - -my $soap= SOAP::Lite->uri($debbugs_soap)->proxy($debbugs_uri); - -open D, "> /dev/null" or die $!; - -my $bugs_ut= $soap->get_usertag($usertag_owner, $usertag_name)->result(); -printf D "bugs_ut: %s\n", Dumper($bugs_ut); - -my $bugs_rq= [map { [bug => $_, dist => $dist] } @{$bugs_ut->{$usertag_name}}]; -printf D "bugs_rq: %s\n", Dumper($bugs_rq); - -my $stats= $soap->get_status($bugs_rq)->result(); -printf D "bugs_rq: %s\nstats: %s\n", Dumper($bugs_rq), Dumper($stats); - -my $stat; - -sub badbug ($) { - my ($msg) = @_; - die "BAD BUG - $msg:\n".Dumper($stat)."\n - $msg !"; -} - -foreach $stat (values %$stats) { - printf D "==========\n%s\n", Dumper($stat); - next if $stat->{'pending'} eq 'done'; - my $fv= $stat->{'found_versions'}; - @$fv or badbug("pending but not found"); - $fv= $fv->[$#$fv]; - my $src= $fv =~ m,/, ? $` : $stat->{'package'}; - $src !~ m/[^-+.0-9a-z]/ and $src =~ m/^[0-9a-z]/ or badbug('bad package'); - my $id= $stat->{'id'}; - $id !~ m/\D/ and $id =~ m/^[1-9]/ or badbug("bad id"); - printf "%s %d\n", $src, $id - or die $!; -} - -STDOUT->error and die $!; -close STDOUT or die $!; diff -Nru autopkgtest-2.9.2/xen/adt-openbugs-update autopkgtest-2.10/xen/adt-openbugs-update --- autopkgtest-2.9.2/xen/adt-openbugs-update 2014-03-12 07:13:55.000000000 +0000 +++ autopkgtest-2.10/xen/adt-openbugs-update 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -#!/bin/bash -# -# This script expects to be given at least two arguments: -# directory to cd to -# main config file for adt-testreport-runloop which sets PATH if need be -# remaining arguments are passed through to a-t-r unchanged - -set -e - -echo "The adt-openbugs-* scripts are unmaintained and deprecated in favor of" >&2 -echo "http://ci.debian.net, debci, and/or jenkins. They will go away soon if " >&2 -echo "nobody uses them any more; so if you still do, please mail " >&2 -echo "autopkgtest-devel@lists.alioth.debian.org. Thanks!" >&2 - -export openbugs_kind=debbugs -export openbugs_debbugs_soap=Debbugs/SOAP -export openbugs_debbugs_uri=http://bugs.debian.org/cgi-bin/soap.cgi -export openbugs_usertag_owner=autopkgtest@packages.debian.org -export openbugs_usertag_name=autopkgtest - -cd "$1" -shift -. "$1" - -: "${openbugs_file_to_fetch:=${suppresspackages:-openbugs}}" -export openbugs_file_to_fetch - -: "${openbugs_file_to_lock:=$openbugs_file_to_fetch-lock}" - -echo 'locking' - -with-lock-ex -f "$openbugs_file_to_lock" bash -c ' - . "$1" - - f="$openbugs_file_to_fetch" - - export distro - - echo fetching - ${openbugs_fetch:-adt-openbugs-fetch-$openbugs_kind} \ - >"$f".new - - echo results - nl -ba -- "$f".new - - if ! test -s "$f".new; - then - echo >&2 "NO OPENBUGS - PROBABLY WENT WRONG" - exit 1 - fi - - mv -- "$f".new "$f" - - if [ "x$openbugs_copy_destination" != x ]; then - echo "uploading" - RSYNC_RSH=ssh rsync "$f" "$openbugs_copy_destination" - fi - echo done. -' x "$@" diff -Nru autopkgtest-2.9.2/xen/adt-testreport-cronjob autopkgtest-2.10/xen/adt-testreport-cronjob --- autopkgtest-2.9.2/xen/adt-testreport-cronjob 2014-03-12 07:13:55.000000000 +0000 +++ autopkgtest-2.10/xen/adt-testreport-cronjob 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -#!/bin/bash -# -# This script expects to be given at least two arguments: -# directory to cd to -# main config file for adt-testreport-runloop which sets PATH if need be -# remaining arguments are passed through to a-t-r unchanged - -set -e -echo "The adt-testreport-* scripts are unmaintained and deprecated in favor of" >&2 -echo "http://ci.debian.net, debci, and/or jenkins. They will go away soon if " >&2 -echo "nobody uses them any more; so if you still do, please mail " >&2 -echo "autopkgtest-devel@lists.alioth.debian.org. Thanks!" >&2 - -cd "$1" -shift -. "$1" -exec >>var/overall.log 2>&1 -${ADT_GO_ANYWAY:-false} || test -f go -with-lock-ex -q cronjob-lock \ - adt-testreport-runloop max_test_count=100 "$@" diff -Nru autopkgtest-2.9.2/xen/adt-testreport-onepackage autopkgtest-2.10/xen/adt-testreport-onepackage --- autopkgtest-2.9.2/xen/adt-testreport-onepackage 2014-03-12 07:13:55.000000000 +0000 +++ autopkgtest-2.10/xen/adt-testreport-onepackage 1970-01-01 00:00:00.000000000 +0000 @@ -1,528 +0,0 @@ -#!/bin/bash - -set -e -echo "The adt-testreport-* scripts are unmaintained and deprecated in favor of" >&2 -echo "http://ci.debian.net, debci, and/or jenkins. They will go away soon if " >&2 -echo "nobody uses them any more; so if you still do, please mail " >&2 -echo "autopkgtest-devel@lists.alioth.debian.org. Thanks!" >&2 - -salt='' -tmp=tmp -var=var -rsync=rsync -disable=true -interactive=true -target=source -suppressrepeatedemails=false -arch=`dpkg --print-architecture` -logheadmaxbytes=32768 -logtailmaxbytes=32768 -upload_src=false - -for config in "$@"; do - case "$config" in - *=*) eval "$config" ;; - *) . "$config" ;; - esac -done - -if $disable; then - echo >&2 'disabled because config inadequate (no disable=false)' - exit 1 -fi - -: ${destdirtail:=$distro-$target} -: ${destdirfin:="$destdircommon$destdirtail"} - -case $target in -source) - sources=Sources - descx='' - ;; -binary-*) - sources=Packages - descx="${target#binary-}" - ;; -*) - echo >&2 'target must be source or binary-*' - exit 1 -esac - -exec 3>&1 -printf >&3 "starting " - -rm -rf "$tmp" -mkdir "$tmp" - ->"$tmp"/_log_raw - -if $interactive; then - echo '(log diverted to stdout)' >>"$tmp"/_log_raw -else - exec >>"$tmp"/_log_raw -fi -exec 4>&1 - -progress () { - echo "++++++ $1 ++++++" -} - -gurl () { - progress "fetching $1" - curl -fsS "$1" >"$2" -} - -gurl "$mirror/dists/$distro/$suite/$target/$sources.gz" "$tmp"/_$sources.gz -zcat "$tmp"/_$sources.gz >"$tmp"/_$sources-in - -lastinfo="$var"/lastinfo-$target -: "${scorelog:="$var"/scores-$target}" - -now=`date +%s` ->>"$lastinfo" - -progress selecting - -if test $target = source; then - blacklist="$blacklistsourcepackages" -else - blacklist="$blacklistbinarypackages" -fi - -if [ "x$pkg" = x ]; then - pkg="`perl -e ' - use IO::Handle; - - $pre= "[-+.0-9a-z]+"; - $vre= "[-+.0-9a-zA-Z:~]+"; - - sub f1() { $fn=shift @ARGV; open F, $fn or die "$fn $!"; } - sub f2() { F->error and die "$fn $!"; close F or die "$fn $!"; } - - $scorelog= "'"$scorelog"'"; - if (length $scorelog) { open SCORE, "> $scorelog.new" or die $!; } - sub pscore ($;$) { - return unless length $scorelog; - printf SCORE "%$_[1]s", $_[0] or die $!; - } - - sub readpkglist ($$) { - my ($arrayref, $filename) = @_; - return unless length $filename; - unshift @ARGV, $filename; f1(); - while () { - next if m/^\#/ or !m/\S/; - die unless m/^($pre)(?:\S.*)?\s*$/; - $arrayref->{$1}= 1; - } - f2(); - } - readpkglist(\%suppress, "'"$suppresspackages"'"); - readpkglist(\%blacklist, "'"$blacklist"'"); - - f1(); - while () { - die unless m/^($pre) ($vre) (\d+)( .*)?$/; - $lastver{$1}= $2; - $lasttime{$1}= $3; - $extras{$1}= $4." "; - } - f2(); - f1(); - $best_score= -2e9; - sub scorepackage () { - return if length $skip; - return if $blacklist{$package}; - return if $score < $best_score - or ($score==$best_score and \ - $package gt $best_package); -#printf STDERR " <----- best score=%s best_score=%s\n", $score, $best_score; - pscore(" (best)"); - $best_score= $score; - $best_package= $package; - } - sub endpackage () { - return unless (defined $package - or defined $version - or defined $skip - or defined $source); - die unless defined $package; - die unless defined $version; - $source= $package if !defined $source; - - $score= '$now' - $lasttime{$package}; - pscore("$package ",-30); - pscore("$source ",-25); - pscore("$score",10); - - if ($score>1e7) { - $score= 1e7; - $scorechars.='c'; - } - pscore(" $lastver{$package}",-25); - pscore(" $version ",-25); - $scorechars= ""; - if ($lastver{$package} ne $version) { - $score *= 5; - $scorechars.="U"; - } - if ($extras{$package} =~ m/ nt /) { - $scorechars.="n"; - } else { - $score *= 10; - } - if ($suppress{$source}) { - $score -= 2e7; - $scorechars.="s"; - } - $scorechars.="[$skip]" if length $skip; - - pscore("-$scorechars",-7); - pscore("$score",10); - -#print STDERR "SCORE package=$package score $score source=$source\n"; - scorepackage(); - pscore("\n"); - undef $package; - undef $version; - undef $skip; - undef $source; - } - while () { - if (m/^Package: ($pre)$/) { - die if defined $package; - $package= $1; - } elsif (m/^Version: ($vre)$/) { - die if defined $version; - $version= $1; - } elsif (m/^Source: ($pre)$/) { - die if defined $source; - $source= $1; - } elsif (m/^Architecture:.*/ && - !m/\s(?:'$arch'|all|any)\s/) { -#printf STDERR " <----- skip %s %s\n", $&, "'$arch'"; - $skip .= 'a'; - } elsif (m/^$/) { - endpackage(); - } - } - f2(); - endpackage(); - if (length $scorelog) { - close SCORE or die $!; - rename "$scorelog.new","$scorelog" or die $!; - } - die unless length $best_package; - open L, ">&4" or die $!; - printf L "selected %s (age %s, score %d)\n", - $best_package, - exists($lastime{$best_package}) - ? '$now' - $lasttime{$best_package} - : "", - $best_score; - print "$best_package\n" or die $!; - ' "$lastinfo" "$tmp"/_$sources-in`" -else - printf >&4 "package forced: %s\n" "$pkg" -fi - -sed -n "/^Package: $pkg\$/,/^\$/p" \ - <"$tmp"/_$sources-in >"$tmp"/_this-stanza - -echo -cat "$tmp"/_this-stanza - -getfield () { - eval 'p'$1'="` - sed -n '\''s/^'$1': //p'\'' \ - <"$tmp"/_this-stanza - `"' -} - -printf >&3 "selected \"%s\" " $pkg - -tp="$tmp/$pkg" -mkdir "$tp" "$tp/src" "$tp/tmp" "$tp/out" - -getfield Version - -getfield Source -if [ "x$pSource" != x ]; then - src="$pSource" -else - src="$pkg" -fi - -if test $target = source; then - getfield Directory - leafnames="` - sed -n '/^Files:/,/^([^ ].*)?$/{ /^ /{ - s/^ [0-9a-z][0-9a-z]* *[0-9][0-9]* //; p - }}' \ - <"$tmp"/_this-stanza - `" - for leafname in $leafnames; do - df="$tp/src/$leafname" - case "$leafname" in - */*|.*) echo >&2 "bad leafname: $leafname"; exit 1;; - *.dsc) fot="$df";; - esac - gurl "$mirror/$pDirectory/$leafname" "$df" - done - testmode=--source - testmode2='' - desc="$pkg" - : ${upload_if_ok:=true} - email_package_header="$email_sourcepackage_header" -else - getfield Filename - fot="$tp/src/$pkg.deb" - gurl "$mirror/$pFilename" "$fot" - testmode='--binaries=install --binary' - testmode2=--instantiate - desc="$pkg $descx" - : ${upload_if_ok:=false} - email_package_header="$email_binarypackage_header" -fi - -if [ "x$maintainer_email_override" = x ]; then - getfield Maintainer - maintainer_email=pMaintainer -else - maintainer_email=maintainer_email_override -fi - -printf >&3 "adt-run " - -progress "starting test" - -xrc () { - printf "+ %s\n" "$*" - set +e - "$@" - rc=$? - set -e -} - -echo 'fatal: adt-run did not start properly' >"$tmp"/_summary - -xrc adt-run --output-dir "$tp"/tmp \ - --log-file "$tp"/log \ - --summary "$tmp"/_summary \ - $adtrun_extra_opts \ - $testmode "$fot" $testmode2 \ - --- \ - adt-virt-xenlvm \ - $adtvirt_extra_opts \ - --distro="$distro" \ - -- \ - 2>&1 3>&- 4>&- - -printf >&3 "%s " $rc - -ourx=0 -upload=true -: ${upload_if_notests:=false} -extras='' - -case "$rc" in -0) summary='all OK'; email='' - upload=$upload_if_ok ;; -2) summary='OK (some skipped)'; email='' - upload=$upload_if_ok ;; -8) summary='package declares no tests'; email='' - upload=$upload_if_notests; extras='nt' ;; -4|6) summary='test(s) failed!'; email="$maintainer_email" ;; -12) summary='erroneous package!'; email="$maintainer_email" ;; -16) summary='testbed failed!'; email="administrator_email" ;; -*) summary='unexpected failure!'; email="administrator_email"; ourx=20;; -esac - -progress "RESULTS $summary" - -if [ "x$suppresspackages" != x ] \ - && grep -x "$src" "$suppresspackages" >/dev/null; then - printf >&3 "email-suppressed " - email='' -fi - -if $upload; then - progress "bundling" - printf "\n%s\n" "$summary" >>"$tmp"/_summary - - edest=${email%_email} - esummary="$var"/emailed/last-$pkg,$edest - if [ "x$edest" = x ]; then - printf >&3 "email-none " - rm -f "$var"/emailed/last-$pkg,* - esummary='' - elif $suppressrepeatedemails \ - && [ -f "$esummary" ] \ - && diff -u "$esummary" "$tmp"/_summary >"$var"/emailed/diff-$pkg; then - printf >&3 "email-same $email " - email='' - esummary='' - else - cp "$tmp"/_summary "$esummary".new - fi - - ln -f "$tmp"/_summary "$tp"/summary - - for odir in tmp out; do - if test -d "$tp"/$odir; then - GZIP=-2 tar -f "$tp"/$odir.tar.gz -C "$tp" -zc $odir - rm -r "$tp"/$odir - fi - done - - if ! $upload_src; then - rm -r "$tp"/src - fi - - progress "uploading" - printf >&3 "uploading" - $rsync -rltH --safe-links --delete "$tp" "$destrsynchead/$destdirfin/" - printf >&3 " " -fi - -if [ "x$email" != x ]; then - progress "contacting $email" - eval "email_addr=\$$email" - printf >&3 "email \"%s\" " "$email_addr" - cat >"$tmp"/_email_header <"$tmp"/_email "%s" "$email_package_header" - - cat >>"$tmp"/_email <>"$tmp"/_email - cat >>"$tmp"/_email <>"$tmp"/_email <>"$tmp"/_email <>"$tmp"/_email <&2 "huh email $email is what why?" - exit 1 - ;; - esac - cat >>"$tmp/_email" <>"$var"/log "%s=%s rc=%s emailed='%s'\n" \ - "$target" "$pkg" $rc "$email_addr" - -if [ "x$ourx" = x0 ]; then - sed -e "/^$pkg /d" <"$lastinfo" >"$lastinfo".new - printf "%s %s %s %s\n" "$pkg" "$pVersion" "$now" "$extras" \ - >>"$lastinfo".new - mv "$lastinfo".new "$lastinfo" - progress "tested." -else - progress "fault ($ourx)." -fi - -perl <"$tmp"/_log_raw >"$tmp"/_log -ne ' - s/[^\012\040-\133\135-\176]/ - $& eq "\t" ? "\\t" : - $& eq "\r" ? "\\r" : - $& eq "\b" ? "\\b" : - $& eq "\\" ? "\\\\" : - sprintf "\\x%02x", ord $& - /ge; - - if (!$middle) { - $headlen += length; - $middle=1 if $headlen > '"$logheadmaxbytes"'; - } - if (!$middle) { - print or die $!; - } else { - $taillen += length; - push @tail, $_; - while ($taillen > '"$logtailmaxbytes"') { - $taillen -= length shift @tail; - $some_dropped= 1; - } - } - END { - print "...\n" or die $! if $some_dropped; - print @tail or die $!; - } -' - -if [ "x$email" = x ]; then - if $interactive; then - cat "$tmp"/_log >&2 - fi -else - cat >>"$tmp"/_email 2>&1 "$tmp"/_log ||: - - if [ "x$email_signing_key" != x ]; then - printf >&3 "signing " - echo >>"$tmp/_email" - gpg -u"$email_signing_key" --clearsign \ - <"$tmp/_email" >"$tmp/_email.asc" - mv -f "$tmp/_email.asc" "$tmp/_email" - fi - cat "$tmp/_email_header" "$tmp/_email" >"$tmp/_email.new" - mv -f "$tmp/_email.new" "$tmp/_email" - - if $interactive; then - cat "$tmp"/_email >&2 - else - sendmail -odi -oem -t -oi <"$tmp"/_email - if [ "x$esummary" != x ]; then - printf >&3 "email-recorded " - mv "$esummary".new "esummary" - fi - fi -fi - -printf >&3 "done %s.\n" $ourx -exit $ourx diff -Nru autopkgtest-2.9.2/xen/adt-testreport-onepackage.1 autopkgtest-2.10/xen/adt-testreport-onepackage.1 --- autopkgtest-2.9.2/xen/adt-testreport-onepackage.1 2014-03-12 07:13:55.000000000 +0000 +++ autopkgtest-2.10/xen/adt-testreport-onepackage.1 1970-01-01 00:00:00.000000000 +0000 @@ -1,212 +0,0 @@ -.TH adt\-testreport\-onepackage 1 2007 autopkgtest "Linux Programmer's Manual" -.SH NAME -adt\-testreport\-onepackage \- choose one package and test it with adt-run -.SH SYNOPSYS -.B adt\-testreport\-onepackage -.RI [ variable \fB=\fR value | settings\-file ]... -.br -.SH DESCRIPTION -.B adt\-testreport\-onepackage -is a rather ad-hoc script which chooses a package to test, calls -adt-run, and reports the results. In a service installation -a-t-o is usually called from -.BR adt\-testreport\-runloop . - -a-t-o has the following functionality: - -a-t-o downloads the Sources or Packages file, chooses a package to -test (see below), downloads its source, invokes \fBadt\-run\fR, writes a -report describing the outcome, and emails the report to some -appropriate address. - -\fBWARNING\fR - it is essential to reconfigure this program before -use, as the supplied examples will \fBsend emails\fR to people who -will become \fBvery upset\fR with you! -.SH CONFIGURATION -Command-line arguments containing \fB=\fR are interpreted by a-t-o -with \fBeval\fR; other arguments are sourced using \fB.\fR, -in each case interpreted as bash script. Configuration fragment -authors should bear in mind that a-t-o uses \fBset -e\fR. - -Various variables can be set for useful effect. A selection of the -most usual ones, with default values, can be seen at the top of the -a-t-o script itself. Certain others are mentioned in this manpage. -There is no exhaustive list and no documentation of the semantics. -.SH PACKAGE AND TEST SELECTION -The configuration variable \fBtarget\fR specifies whether a source -package, or a binary package, is to be tested. It should be set to -\fBsource\fR or \fBbinary\-\fR\fIarch\fR. - -a-t-o maintains a record of when each package was last tested, what -version was tested, and whether the package had any tests. - -This record is used to choose which package should be tested next: -packages which have changed since the last test are preferred, as are -packages which didn't lack tests last time they were examined. - -If the configuration sets \fBpkg\fR to a package name (for example if -\fBpkg=\fR\fIpackage\fR is passed as an argument), this overrides -a-t-o's package selection algorithm. -.SH REPORTING -If \fBinteractive\fR is set to \fBtrue\fR (the default), a-t-o will -not redirect the output from adt-run and will not email anyone, -although the start of the email which would have been sent is sent to -stdout. If \fBinteractive\fR is \fBfalse\fR, a-t-o sends an email to -its administrator (if a-t-o considers that the testing machinery is -broken, or if \fBmaintainer_email_override\fR is set), or otherwise to -the package maintainer. - -No email is sent if there were no tests, or all the tests skipped or -passed. - -The emailed report contains a summary of the outcome of the tests, and -the output from adt-run. Additionally, if an email is sent, the build -trees, test results, and so forth, will be uploaded to the location -specified with the \fBdest\fR* options (see the -\fBonepackage-config\fR example configuration file). - -Some vague progress information is printed to a-t-o's stdout. -.SH AUTOMATIC BUG REPORTING -With suitable configuration, a-t-o can be made to automatically file -bugs when it detects a problem with a package. - -It is necessary to avoid the submission of multiple reports for the -same problem. This is done by fetching somehow a list of the open bug -reports from the relevant bug system and extracting a list of the -source package names. These are to be listed in the file named by the -.B suppresspackages -configuration variable. Testing frequency of these source packages is -reduced, and when a problem is found the email is not sent. - -When the system does decide to send an email about a package it will -normally email the maintainer as determined from the package's control -file. To submit bugs instead, set -.B maintainer_email_override -to the submission email address for the bug system. You must also set -.BR email_sourcepackage_header and email_binarypackage_header -to appropriate templates. These templates specify what information -should be prepended at the top of the body (not the RFC822 header) of -the mail to be sent. In these templates -.B @p -stands for the package name being tested (the source package name for -source packages or the binary package name for binary package tests), -.B @v -stands for the version being tested, -.B @s -stands for the source package name (even if a binary package generated -by that source is being tested) and -.B @a -stands for a single at sign \fB@\fR. - -If you an appropriately useable GPG signing key is available, you may -specify -.B email_signing_key -which is passed to gpg's \fB-u\fR option. Otherwise the email is not -signed. -.SH FILES -The \fBtmp=\fR\fItmp\fR and \fBvar=\fR\fIvar\fR configuration -variables name two directories which must belong solely to this -instance of a-t-o. - -\fItmp\fR will be erased by a-t-o at startup and then used for -temporary files. It is not cleaned up afterwards; it is assumed that -the next run of a-t-o will do that. \fItmp\fR should not be made to -refer to a symlink or mountpoint as a-t-o would break the link or -attempt to remove the mountpoint; specify a subdirectory instead. - -\fIvar\fR is used to record the state, including the information about -each package used for package selection. \fIvar\fR\fB/log\fR contains -a one-line record of each test run and may need to be rotated. - -\fItmp\fR and \fIvar\fR default to \fBtmp\fR and \fBvar\fR in a-t-o's -starting directory. -.SH EXIT STATUS -0 a package was apparently tested -.br -20 adt-run reported an unexpected failure -.br -other other unexpected failures including bad usage, disk full, etc. - -When a-t-o is run in a loop, the loop should stop pending -administrator intervention if a-t-o exits nonzero. -.SH FILES -.TP -.IR tmp " (default: \fB./tmp\fR)" -Temporary directory for working files. Do not specify /tmp. -.TP -.IR var " (default: \fB./var\fR)" -Storage directory for package testing history, score reports, -logfiles, etc. -.TP -.IB var /lastinfo- target -Information about the last test and outcome for each package. This is -used for package scoring and selection. -.TP -.IB var /scores- target -Report giving the score for each package, and the factors which -influenced that score. -.TP -.IB var /emailed/last- pkg , emailaddress -The summary of the last message sent to emailaddress about pkg. -If the configuration variable \fBsuppressrepeatedemails\fR is -\fBtrue\fR then this is used to ensure that a maintainer (or the -test installation operator) is only emailed when the situation for a -particular package changes. -.TP -.IB var /emailed/diff- pkg -Changes to the summary for the last email sent regarding pkg. -This can be used to find out why an email was sent. -.TP -.IB var /log -Logfile from a-t-o. If a-t-runloop is being used its stdout output -often makes a better logfile. -.TP -.IB destrsynchead / destdirfin / pkg -Full logfile and other information is rsync'd here. It is assumed -that this area will be published via a webserver. -.SH SEE ALSO -\fBadt-run\fR(1). -.SH BUGS -\fBIt is essential not to use the example configuration!\fR -This configuration is likely to send inappropriate emails! - -There is no documentation for the variable settings, and no error -handling for detecting attempts to set incorrectly named variables. - -The tuning parameters for the package selection algorithm cannot be -adjusted. This algorithm is not hugely sophisticated. There should -be a facility for explicitly requesting retests (other than setting -\fBpkg\fR); there should be some kind of manual prioritisation queue. - -Distributions whose management systems permit archive skew (that is, -distributions whose contents sometimes contains unsatisfiable -dependencies) cause pathological behaviour. a-t-o will prefer to test -the newly-changed packages and immediately detect and report the -archive skew as test failures. It would be better if it would detect -this situation and not report a failure unless the problem persisted. -And there ought to be an option to have it not try to test a package -until its version has been stable for a nominated period. - -If multiple distributions (multiple values of \fBdistro\fR) are used, -a-t-o will conflate their last-tested versions. It should use -separate files. - -Cross-architecture testing (where host and target have differing -Debian architectures) has not been tested and is likely to have -bugs both in interfaces and implementation. - -a-t-o should be capable of automatically closing bug reports if it -retests a package and finds that the bug is fixed. - -The script lacks flexibility in many respects; many additional -configuration settings and hooks are needed. - -There is no facility for sharing test queues across multiple -machines. This means that it is difficult to share the testing load. -.SH AUTHORS AND COPYRIGHT -This manpage is part of autopkgtest, a tool for testing Debian binary -packages. autopkgtest is Copyright (C) 2006-2007 Canonical Ltd and -others. - -See \fB/usr/share/doc/autopkgtest/CREDITS\fR for the list of -contributors and full copying conditions. diff -Nru autopkgtest-2.9.2/xen/adt-testreport-runloop autopkgtest-2.10/xen/adt-testreport-runloop --- autopkgtest-2.9.2/xen/adt-testreport-runloop 2014-03-12 07:13:55.000000000 +0000 +++ autopkgtest-2.10/xen/adt-testreport-runloop 1970-01-01 00:00:00.000000000 +0000 @@ -1,107 +0,0 @@ -#!/bin/bash -# This file is part of autopkgtest -# autopkgtest is a tool for testing Debian packages -# -# autopkgtest is Copyright (C) 2006 Canonical Ltd. -# -# 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., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# See the file CREDITS for a full list of credits information (often -# installed as /usr/share/doc/autopkgtest/CREDITS). - -set -e - -echo "The adt-testreport-* scripts are unmaintained and deprecated in favor of" >&2 -echo "http://ci.debian.net, debci, and/or jenkins. They will go away soon if " >&2 -echo "nobody uses them any more; so if you still do, please mail " >&2 -echo "autopkgtest-devel@lists.alioth.debian.org. Thanks!" >&2 - -max_test_count=10 -: ${ADT_GO_ANYWAY:=false} - -for arg in "$@"; do - case "$arg" in - !*) arg="${arg#!}" ;; - *) onepackage_args[${#onepackage_args[*]}]="${arg#@}" ;; - esac - - case "$arg" in - @*) ;; - *=*) eval "$arg" ;; - *) . "$arg" ;; - esac -done - -if [ "x$distro" = x ]; then - : ${testbed_check_path:=/var/lib/autopkgtest/xenlvm/adt_${distro}/good} -else - : ${testbed_check_path:=/dev/null} -fi - -if [ "x$test_classes" = x ]; then - : ${architecture:=`dpkg --print-architecture`} - test_classes="source $distro, target=source : binary $distro, target=binary-$architecture" -fi - -fail () { printf >&2 "%s\n" "$*"; exit 127; } -progress () { printf "========== %s ==========\n" "$1"; } -x () { printf "+ %s\n" "$*"; "$@"; } -x2 () { printf >&2 "+ %s\n" "$*"; "$@"; } - -progress testing - -test_count=0 - -while ($ADT_GO_ANYWAY || test -f go) && \ - test $test_count -lt $max_test_count; do - now=`date` - printf "%s" "$now: " - - if ! test -e $testbed_check_path; then - printf " testbed broken, bailing\n" - break - fi - - xopts="${test_classes%%:*}" - xopts_opts="${xopts#*,}" - printf "considering (%s) " "$xopts_opts" - - case "$test_classes" in - *:*) test_classes="${test_classes#*:}:$xopts" ;; - esac - - anybroken=false - for x in ${xopts%%,*}; do - if test -f "stop-$x"; then - printf " skipping because of %s" "$x" - anybroken=true - break - fi - done - if $anybroken; then - printf "\n" - continue - fi - - adt-testreport-onepackage \ - adtrun_extra_opts=--built-binaries-filter=__ \ - interactive=false \ - "${onepackage_args[@]}" \ - $xopts_opts - - test_count=$(( $test_count + 1 )) -done - -progress 'stopping' diff -Nru autopkgtest-2.9.2/xen/adt-testreport-runloop.1 autopkgtest-2.10/xen/adt-testreport-runloop.1 --- autopkgtest-2.9.2/xen/adt-testreport-runloop.1 2014-03-12 07:13:55.000000000 +0000 +++ autopkgtest-2.10/xen/adt-testreport-runloop.1 1970-01-01 00:00:00.000000000 +0000 @@ -1,150 +0,0 @@ -.TH adt\-testreport\-runloop 1 2007 autopkgtest "Linux Programmer's Manual" -.SH NAME -adt\-testreport\-runloop \- repeatedly choose and test packages -.SH SYNOPSYS -.B adt\-testreport\-runloop -.RI [[\fB!@\fR] variable \fB=\fR value |[\fB!@\fR] settings\-file ]... -.br -.SH DESCRIPTION -.B adt\-testreport\-runloop -is a rather ad-hoc script which repeatedly invokes -.BR adt\-testreport\-onepackage ; -it is designed to be invoked from cron. - -\fBWARNING\fR - it is essential to reconfigure this program before -use, as the supplied examples will \fBsend emails\fR to people who -will become \fBvery upset\fR with you! -.SH CONFIGURATION -Command-line arguments containing \fB=\fR are interpreted -with \fBeval\fR; other arguments are sourced using \fB.\fR, -in each case interpreted as bash script. - -Supplied arguments are both executed by a-t-r and passed through to -the invocation of a-t-o. You may prefix an argument with \fB@\fR to -indicate that it is for a-t-onepackage only, or with \fB!\fR to -indicate that it is for a-t-runloop only. - -Thus the set of variables which can be set is the union of those for -a-t-runloop itself and those for a-t-onepackage. See the a-t-o -manpage for such information about its configuration as is available. -Configuration fragment authors should bear in mind that both programs -use \fBset -e\fR. - -It is quite permissible to set PATH and other needed environmnet -variables in the configuration file. - -The following variables may be set: -.TP -.B distro -distribution (`suite') to be tested. There is no default. This -variable is used only for the default values of -.B testbed_check_path -and -.BR test_classes . -However, it is probably a convenient way of specifying the intended -effect particularly as attempting to do cross-distribution testing in a -single installation does not work properly right now (see a-t-o's BUGS). -.TP -.B max_test_count -the maximum number of times to invoke a-t-o. This counts both passed -and failed tests, but it doesn't count possible runs which were -suppressed. Default: 10. -.TP -.B go_anway -Run even though the file \fBgo\fR does not exist. See SUPPRESSION, -below. Default: \fBfalse\fR. -.TP -.B architecture -Used in combination with \fBdistro\fR when calculating the right -default for test_classes. The default is the result from -.BR "dpkg --print-architecture" . -.TP -.B testbed_check_path -If the file named by this variable doesn't exist, a-t-r will exit. -This avoids it spinning and reporting many immediate failures due to a -broken testbed. The default is -.BI /var/lib/autopkgtest/xenlvm/adt_ distro /good -if distro is set, which assumes that the Xen-based virtualisation -system is being used; if distro is not set then default is /dev/null -which nullifies this feature. -.TP -.B test_classes -Specifies the set of test classes to try, with the details of each -test class separated by a colon \fB:\fR from the next. a-t-r will run -a-t-o once for each listed test class and then return to the beginning -of the list. - -Tests in each class are thus selected approximately equally often. -(If max_test_count is not a multiple of the number of actual test -classes then early classes are used slightly more.) - -Each test class consists of a set of suppression checks, a comma -\fB,\fR, and some configuration arguments for a-t-o. The suppression -checks are whitespace-separated words; see SUPPRESSION. The -configuration arguments are likewise whitespace-separated. There is -no provision for passing configuration arguments containing spaces to -a-t-o. a-t-o arguments in test classes override other configuration -settings. - -The default is -.BI "source " distro ", target=source : binary " distro , -.BI target=binary- architecture -which tests binary packages and source packages from the same -distribution in alternation -.SH SUPPRESSION -a-t-r is designed to be enabled and disabled by sentinel files. - -Firstly, if the file \fBgo\fR does not exist in its working directory, -it will stop at the first sensible opportunity. (See also the -go_anyway configuration variable.) - -Secondly, test classes may specify suppression checks. For each such -check \fIclasscheck\fR, a-t-r will test for the existence of -.BI stop- classcheck -in its current directory. If that file exists, it will suppress that -class of test. Do not suppress all of the tests without removing -\fBgo\fR. -.SH FILES -.TP -.BI /var/lib/autopkgtest/xenlvm/adt_ distro /good -default sentinel file for testbed_check_path. -.TP -.B ./go -Sentinel file indicating that operation should be enabled. -.TP -.BI ./stop- classcheck -Sentinel file indicating that test classes mentioning \fIclasscheck\fR -should be suppressed. -.LP -adt-testreport-runloop does not use any other files directly, but it -will probably need a configuration file as an argument, and it will -invoke adt-testreport-onepackage which uses many files in the current -directory and which invokes an autopkgtest virtualisation server. -.SH BUGS AND WARNINGS -\fBIt is essential not to use the example configuration!\fR -This configuration is likely to send inappropriate emails! - -There is no locking. Whatever invokes a-t-r should take out a lock of -some kind. See the example cronjobs provided in -.B hosts/*/cronjob -in the source package. - -If all of the test classes are suppressed, a-t-r will spin in a tight -loop looking for something to do. - -The -.B testbed_check_path -feature is rather ad-hoc. It would be better to query the -virtualisation server to be used directly and then suppress the test -class if relevant. (But the infinite loop bug would need to be fixed -too.) - -The design precludes detecting attempts to set incorrectly -named configuration options. -.SH AUTHORS AND COPYRIGHT -This manpage is part of autopkgtest, a tool for testing Debian binary -packages. autopkgtest is Copyright (C) 2006-2007 Canonical Ltd and -others. - -See \fB/usr/share/doc/autopkgtest/CREDITS\fR for the list of -contributors and full copying conditions. diff -Nru autopkgtest-2.9.2/xen/Makefile autopkgtest-2.10/xen/Makefile --- autopkgtest-2.9.2/xen/Makefile 2014-03-12 07:13:55.000000000 +0000 +++ autopkgtest-2.10/xen/Makefile 2014-03-18 15:12:30.000000000 +0000 @@ -23,7 +23,7 @@ include ../settings.make programs = cleanup setup on-testbed with-testbed purge -binprograms = adt-testreport-onepackage adt-testreport-runloop adt-testreport-cronjob +binprograms = shareprograms = fixups fixups-inside userv-target sharefiles = readconfig justconfig