From: Ian Jackson Date: Sat, 30 Jun 2018 21:40:02 +0000 (+0100) Subject: Merge remote-tracking branch 'dgit/dgit/experimental' X-Git-Tag: archive/debian/5.6~7 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=a300724a321a26770ccf701e0a638c7bfa93fa5c;hp=f8ba14071c7977a0ea2d8f1882202136b7b88dce Merge remote-tracking branch 'dgit/dgit/experimental' Conflicts: debian/changelog Signed-off-by: Ian Jackson --- diff --git a/debian/changelog b/debian/changelog index 3b551ec9..92287200 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,28 @@ dgit (5.6~) unstable; urgency=medium - * + * Merge the experimental branch containing the fianl + version of the test suite gnupg workarounds. -- +dgit (5.5+exp9) experimental; urgency=medium + + * test suite: Explicitly start/stop the gnupg agent, around + each call to gnupg. Apropos of #902316 (and #868550). + + * Separate changelog entries for the following test attempts + in experimental have been elided: + dgit (5.5+exp8) experimental; urgency=medium + dgit (5.5+exp7) experimental; urgency=medium + dgit (5.5+exp6) experimental; urgency=medium + dgit (5.5+exp5) experimental; urgency=medium + dgit (5.5+exp4) experimental; urgency=medium + dgit (5.5+exp3) experimental; urgency=medium + dgit (5.5+exp2) experimental; urgency=medium + dgit (5.4+exp1) experimental; urgency=medium + + -- Ian Jackson Sat, 30 Jun 2018 19:03:00 +0100 + dgit (5.5) unstable; urgency=medium * Add missing comma in debian/control. Closes:#902578. diff --git a/debian/tests/control b/debian/tests/control index 8b9d34ef..48ed93fb 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -1,24 +1,24 @@ Tests: build-modes-gbp Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, git-buildpackage +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, git-buildpackage Tests: clone-reprepro downstream-gitless Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, reprepro +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, reprepro Tests: dpkgsourceignores-docs Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc Restrictions: x-dgit-intree-only Tests: defdistro-dsd-clone-drs dsd-clone-drs Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc Restrictions: x-dgit-intree-only x-dgit-git-only Tests: gdr-diverge-nmu gdr-diverge-nmu-dgit gdr-edits gdr-import-dgit gdr-makepatches7 gdr-subcommands Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, git-debrebase, git-buildpackage, faketime +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, git-debrebase, git-buildpackage, faketime Tests: gdr-newupstream gdr-viagit Tests-Directory: tests/tests @@ -26,7 +26,7 @@ Depends: chiark-utils-bin, git-debrebase, git-buildpackage, faketime Tests: gitattributes Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bsdgames, man-db, git-man +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, bsdgames, man-db, git-man Tests: hint-testsuite-triggers Tests-Directory: tests/tests @@ -35,24 +35,24 @@ Restrictions: hint-testsuite-triggers Tests: defdistro-mirror mirror mirror-debnewgit mirror-private Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, rsync +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, rsync Tests: build-modes-sbuild quilt-gbp-build-modes-sbuild Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, sbuild +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, sbuild Restrictions: x-dgit-schroot-build Tests: sbuild-gitish Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, sbuild, man-db +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, sbuild, man-db Restrictions: x-dgit-schroot-build Tests: spelling Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc Restrictions: x-dgit-git-only Tests: absurd-gitapply badcommit-rewrite build-modes build-modes-asplit build-modes-gbp-asplit clone-clogsigpipe clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp defdistro-rpush defdistro-setup distropatches-reject dpkgsourceignores-correct drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast gbp-orig gitconfig gitworktree import-dsc import-maintmangle import-native import-nonnative import-tarbomb inarchivecopy mismatches-contents mismatches-dscchanges multisuite newtag-clone-nogit oldnewtagalt oldtag-clone-nogit orig-include-exclude orig-include-exclude-chkquery overwrite-chkclog overwrite-junk overwrite-splitbrains overwrite-version protocol-compat push-buildproductsdir push-newpackage push-newrepeat push-nextdgit push-source push-source-with-changes quilt quilt-gbp quilt-gbp-build-modes quilt-singlepatch quilt-splitbrains quilt-useremail rpush tag-updates test-list-uptodate trustingpolicy-replay unrepresentable version-opt Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc diff --git a/tests/enumerate-tests b/tests/enumerate-tests index 0599b69e..0f37c961 100755 --- a/tests/enumerate-tests +++ b/tests/enumerate-tests @@ -42,7 +42,7 @@ finish- () { test-begin-gencontrol () { restrictions='' - dependencies='dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin' + dependencies='dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc' } restriction-gencontrol () { diff --git a/tests/lib b/tests/lib index f3fb0dab..bad47c90 100644 --- a/tests/lib +++ b/tests/lib @@ -41,6 +41,7 @@ export DGIT_TEST_TROOT=$troot tmp=$ADTTMP if [ x"$tmp" = x ]; then + export DGIT_TEST_BYHAND=1 mkdir -p tests/tmp tmpbase=$troot/tmp tmp=tests/tmp/$testname diff --git a/tests/setup/gnupg b/tests/setup/gnupg index c88d40be..7a164eff 100755 --- a/tests/setup/gnupg +++ b/tests/setup/gnupg @@ -7,10 +7,11 @@ cp $troot/gnupg/* $tmp/gnupg chmod go-rw $tmp/gnupg/* export DGIT_TEST_GNUPG_GLOBAL_LOCK=$tmp/gnupg/dgit-test-global-lock +export DGIT_TEST_GNUPG_LOG=$tmp/gnupg-workarounds.log setup=' export GNUPGHOME=$tmp/gnupg - export DGIT_TEST_GNUPG_GLOBAL_LOCK + export DGIT_TEST_GNUPG_GLOBAL_LOCK DGIT_TEST_GNUPG_LOG cat >$tmp/gnupg/gpg-agent.conf <&2 2>>"$DGIT_TEST_GNUPG_LOG" + rc=$? + if [ $rc = 0 ]; then exit 0; fi + if [ "x$DGIT_TEST_BYHAND" != x ]; then + echo >&2 "BYHAND, not dumping $DGIT_TEST_GNUPG_LOG" + else + echo >&2 "########################################" + echo >&2 "$DGIT_TEST_GNUPG_LOG" + sed '\''s/^/\[gnupg-workarounds] /'\'' >&2 \ + "$DGIT_TEST_GNUPG_LOG" + echo >&2 "end of $DGIT_TEST_GNUPG_LOG" + echo >&2 "########################################" + fi + exit $rc + ' x \ + "$DGIT_TEST_TROOT"/tstunt/gpg-withagent "$@" diff --git a/tests/tstunt/gpg-withagent b/tests/tstunt/gpg-withagent new file mode 100755 index 00000000..b7b8bfd7 --- /dev/null +++ b/tests/tstunt/gpg-withagent @@ -0,0 +1,68 @@ +#!/bin/sh +set -ex + +d () { + date --iso-8601=ns >&2 + ps -ef | grep gpg-agent >&2 ||: +} + +d + +retry_until_ok () { + sleeptime=0 + d + while ! "$@"; do + d + case $sleeptime in + ??.*) + echo >&2 "$0: GPG AGENT STARTP $@ TIMED OUT" + exit 127 + ;; + esac + sleep $sleeptime + sleeptime=$(echo "($sleeptime + 0.001) * 2" | bc -l) + done +} + +kill_agent_not_running () { + LC_MESSAGES=C gpg-connect-agent --no-autostart &1 \ + | tee -a /dev/stderr \ + | grep 'no gpg-agent running' >&2 +} + +echo >&2 'GPG-WITHAGENT... PRE-STOPPING' + +retry_until_ok kill_agent_not_running + +agent_is_running () { + gpg-connect-agent --no-autostart &1 \ + | grep dgit-gpg-agent-ok >&2 +} + + +$DGIT_STUNT_AGENT --daemon &2 +retry_until_ok agent_is_running + +echo >&2 'GPG-WITHAGENT... RUNNING' + +d + +set +e +$DGIT_TEST_REAL_GPG \ + --agent-program=$DGIT_STUNT_AGENT "$@" 2>&9 +rc=$? +set -e + +d + +echo >&2 'GPG-WITHAGENT... STOPPING' + +retry_until_ok kill_agent_not_running + +echo >&2 'GPG-WITHAGENT... DONE' + +d + +exit $rc