17 lines: ${BASH_LINENO[*]}
18 files: ${BASH_SOURCE[*]}
25 trap 'test $? = 0 || t-report-failure' EXIT
27 t-filter-out-git-hyphen-dir
31 : ${DGIT_TEST_DEBUG=-D}
32 export DGIT_TEST_DEBUG
34 : ${DGIT_TEST_DEBPUSH_DEBUG=x}
35 export DGIT_TEST_DEBPUSH_DEBUG
37 : ${DGIT_TEST_DISTRO+ ${distro=${DGIT_TEST_DISTRO}}}
39 export GIT_COMMITTER_DATE='1530000000 +0100'
40 export GIT_AUTHOR_DATE='1530000000 +0100'
42 export LC_CTYPE=C.UTF-8
46 testname="${DGIT_TEST_TESTNAME-${0##*/}}"
47 export DGIT_TEST_TROOT=$troot
51 if [ x"$tmp" = x ]; then
52 export DGIT_TEST_BYHAND=1
55 tmp=tests/tmp/$testname
58 elif [ "x$DGIT_TEST_TMPBASE" != x ]; then
59 tmpbase="$DGIT_TEST_TMPBASE"
67 test -f $tmp/.save-env || \
68 env -0 >$tmp/.save-env
72 export DEBCHANGE_VENDOR=dpkg
76 mkdir -p $tmp/incoming
77 cat <<END >$tmp/dput.cf
80 incoming = $tmp/incoming
84 schroot=${DGIT_SCHROOT_CHROOT:-build}
85 # Pretty much any Debian sid snapshot schroot will do.
87 : ${t_archive_method:=aq}
88 : ${tagpfx:=archive/test-dummy}
89 : ${suitespecs:=sid:unstable}
92 GIT_COMMITTER_DATE="$(( ${GIT_COMMITTER_DATE%% *} + 1 )) ${GIT_COMMITTER_DATE#* }"
93 GIT_AUTHOR_DATE="$GIT_COMMITTER_DATE"
97 local mpat="$1"; shift
100 LC_MESSAGES=${expect_fail_lcmessages-C} \
101 LANGUAGE=${expect_fail_lcmessages-C} \
102 "$@" 2>&1 | tee $tmp/t.output
103 local ps="${PIPESTATUS[*]}"
107 "0 0") fail "command unexpectedly succeeded (instead of: $mpat)" ;;
109 *) fail "tee failed" ;;
112 t-grep-mpat "$mpat" $tmp/t.output
123 E:*) grepper=egrep ;;
124 F:*) grepper=fgrep ;;
125 *) fail "bad mpat prefix in $mpat";;
131 $grepper -e "$mpat" "$file" ||
132 fail "message not found"
135 t-expect-push-fail () {
136 local mpat="$1"; shift
138 local triedpush; triedpush=`git rev-parse HEAD`
141 t-expect-fail "$mpat" "$@"
143 diff $tmp/show-refs.{pre,post}-push
145 t-git-objects-not-present '' $triedpush
147 eval "$t_expect_push_fail_hook"
150 t-git-objects-not-present () {
151 # t-git-objects-not-present GITDIR|'' OBJID [...]
152 # specifying '' means the repo for package $p
153 local gitdir="${1-$dgitrepo}"
155 if ! [ -e "$gitdir" ]; then return; fi
158 t-expect-fail 'unable to find' \
164 local whichoutput=$1; shift
165 local whichrepo=${1-$dgitrepo}
166 local outputfile="$tmp/show-refs.$whichoutput"
169 if test -d $whichrepo; then
177 local edittree=$1.edit
178 if test -d "$edittree"; then
179 cp -a "$edittree"/* .
187 t-untar $troot/worktrees/${p}_$1
190 t-select-package () {
192 dgitrepo=$tmp/git/$p.git
199 local gs=$troot/git-srcs/${p}_$v.git
200 (set -e; cd $tmp/git; t-untar $gs)
205 (set -e; cd $tmp/git; tar xf $troot/git-template.tar)
208 t-salsa-add-remote () {
209 local d=$tmp/salsa/$p
211 (set -e; cd $d; git init --bare)
212 git remote add ${1-origin} $d
215 t-git-merge-base () {
216 git merge-base $1 $2 || test $? = 1
220 # t-has-ancestor ANCESTOR
221 # (CHILD is implicit, HEAD)
222 local now; now=`git rev-parse HEAD`
223 local ancestor; ancestor=`git rev-parse $1^{}`
224 local mbase; mbase=`t-git-merge-base $ancestor $now`
225 if [ x$mbase != x$ancestor ]; then
226 fail "not ff $ancestor..$now, $mbase != $ancestor"
230 t-has-parent-or-is () {
231 # t-has-parent-or-is CHILD PARENT
235 parents=$(git show --pretty=format:' %P %H ' "$child")
236 parent=$(git rev-parse "$parent~0")
239 *) fail "child $child lacks parent $parent" ;;
243 t-prep-newpackage () {
250 if ! git show-ref --verify --quiet refs/heads/master; then
251 git branch -m dgit/sid master
259 t-archive-none-$t_archive_method
261 t-archive-none-aq () {
262 mkdir -p $tmp/aq/dsc_in_suite $tmp/mirror/pool/main
268 for suitespec in $suitespecs; do
269 local suite=${suitespec%%:*}
270 local sname=${suitespec#*:}
272 >$tmp/aq/package.$suite.$p
273 t-aq-archive-updated $suite $p
275 >$tmp/aq/package.new.$p
276 t-aq-archive-updated new $p
278 ln -sf $suite $tmp/aq/dsc_in_suite/$sname
280 cat <<END >>$tmp/aq/suites
283 "archive" : "ftp-master",
284 "codename" : "$suite",
297 cat <<END >>$tmp/aq/suites
303 t-aq-archive-updated () {
306 local suitedir=$tmp/aq/dsc_in_suite/$suite
308 perl <$tmp/aq/package.$suite.$p >$suitedir/$p -wne '
312 m{^(\S+) (\w+) ([^ \t/]+)/(\S+)} or die;
320 my $json = JSON->new->canonical();
321 print $json->encode(\@v) or die $!;
326 t-archive-process-incoming () {
328 mv $tmp/incoming/${p}_* $tmp/mirror/pool/main/
329 t-archive-query "$suite"
334 local dscf=main/${p}_${v}.dsc
335 t-archive-query-$t_archive_method "$suite" "$p" "$v" "$dscf"
337 t-archive-query-aq () {
342 local sha; sha=`sha256sum <$tmp/mirror/pool/$dscf`
343 echo "${v} ${sha% -} $dscf" >>$tmp/aq/package.$suite.${p}
344 t-aq-archive-updated $suite $p
350 local dscf=${p}_$2.dsc
351 rm -f $tmp/mirror/pool/main/${p}_*
352 ln -s $troot/pkg-srcs/${p}_${2%-*}* $tmp/mirror/pool/main/
353 t-archive-query $suite
356 (set -e; cd $tmp/extract; dpkg-source -x ../mirror/pool/main/$dscf)
359 t-git-dir-time-passes () {
360 touch -d 'last year' $dgitrepo
364 local gitdir=$dgitrepo
367 if test -e "$gitdir"; then fail "$gitdir exists"; fi
370 public) wantstat='7[75]5' ;;
371 secret) wantstat='7[70]0' ;;
372 *) fail "$1 t-git-dir-check ?" ;;
374 gotstat=`stat -c%a $gitdir`
376 *$wantstat) return ;;
377 *) fail "$gitdir has mode $gotstat, expected $wantstat" ;;
381 t-expect-fsck-fail () {
382 echo >>$tmp/fsck.expected-errors "$1"
386 local fsckerrs=$(git rev-parse --git-dir)/dgit-test-fsck.errs
389 LC_MESSAGES=C git fsck --no-dangling --strict 2>&1 \
391 ps="${PIPESTATUS[*]}"
395 if [ -f $tmp/fsck.expected-errors ]; then
396 pats=(-w -f $tmp/fsck.expected-errors)
400 pats+=(-e 'notice: HEAD points to an unborn branch')
401 pats+=(-e 'notice: No default references')
404 grep -v "${pats[@]}" $fsckerrs
408 1) ;; # no unexpected errors
409 0) fail "unexpected messages from git-fsck" ;;
410 *) fail "grep of git-fsck failed" ;;
414 t-check-only-bpd () {
415 if [ "$bpd" = .. ]; then return; fi
417 $tmp/*.{deb,changes,dsc,buildinfo} \
424 for d in $tmp/*/.git $tmp/git/*.git; do
432 : '========================================'
439 t-save-artifacts () {
440 artifacts="$AUTOPKGTEST_ARTIFACTS"
441 if [ x"$artifacts" = x ]; then return; fi
442 if [ x"tmp" = x ]; then return; fi
443 GZIP=-1v tar -C "$tmp" -zc -f "$artifacts/${0##*/}.tar.gz" \
447 t-rm-dput-dropping () {
448 rm -f $tmp/${p}_${v}_*.upload
452 local dgit=${DGIT_TEST-dgit}
455 {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{'
456 $dgit --dgit=$dgit --dget:-u --dput:--config=$tmp/dput.cf \
457 ${dgit_config_debian_alias-"--config-lookup-explode=dgit-distro.debian.alias-canon"} \
458 ${DGIT_GITDEBREBASE_TEST+--git-debrebase=}${DGIT_GITDEBREBASE_TEST} \
459 ${distro+${distro:+-d}}${distro--dtest-dummy} \
460 $DGIT_TEST_OPTS $DGIT_TEST_DEBUG \
461 -kBCD22CD83243B79D3DFAC33EA3DBCBC039B13D8A $t_dgit_xopts "$@"
462 : '}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
469 (export LC_ALL=C.UTF-8
470 if [ "$DGIT_TEST_INTREE" ]; then
471 make -C $DGIT_TEST_INTREE $page.$section.view
478 diff --exclude=.git --exclude=.pc -ruN $*
481 t-files-notexist () {
490 t-cloned-fetched-good () {
491 t-diff-nogit ../extract/$p-${v%-*} .
492 t-clean-on-branch dgit/sid
495 refs/heads/dgit/sid \
496 refs/remotes/dgit/dgit/sid
497 t-refs-notexist refs/dgit/unstable refs/remotes/dgit/dgit/unstable
501 printf "%s${1:+\n}" "$1" >$tmp/t.want
504 diff $tmp/t.want $tmp/t.got
507 t-clean-on-branch () {
508 t-output "## $1" git status -b --porcelain
516 local import=IMPORT.${DGIT_TEST_TESTNAME-${0##*/}}
517 exec 4>$tmp/$import.new
520 for vn in $savevars; do
521 perl >&4 -"I$root" -MDebian::Dgit -e '
522 printf "%s=%s\n", $ARGV[0], shellquote $ARGV[1]
523 ' $vn "$(eval "printf '%s\n' \"\$$vn\"")"
526 perl >&4 -"I$root" -MDebian::Dgit -we '
527 foreach my $vn (grep m/^DGIT_TEST_REAL_/, keys %ENV) {
528 print STDERR "saving-exporting $vn\n";
529 printf "export %s=%s\n", $vn, shellquote $ENV{$vn}
534 (set -e; cd $tmp; tar cf $import.tar $savedirs)
536 printf >&4 "\n%s\n" "$importeval"
538 mv -f $tmp/$import.new $tmp/$import
546 if [ "x$tmpbase" = x ]; then
547 # ADTTMP was set on entry to tests/lib, so we
548 # are not sharing tmp area between tests
550 lock="$tmp/.dummy.lock"
552 setupsrc="$tmpbase/$setupname"
553 lock="$setupsrc.lock"
556 local simport="$setupsrc/IMPORT.$setupname"
558 if ! [ -e "$simport" ]; then
559 with-lock-ex -w "$lock" \
560 xargs -0 -a $tmp/.save-env \
563 setupname="$1"; shift
565 if [ -e "$simport" ]; then exit 0; fi
567 "tests/setup/$setupname"
568 ' x "$root" "$setupname" "$simport"
571 if [ "x$setupsrc" != "x$tmp" ]; then
572 (set -e; cd $tmp; tar xf "$simport.tar")
578 t-git-get-ref-exact () {
580 # does not dereference, unlike t-git-get-ref
583 *) fail "t-git-get-ref-exact bad $ref" ;;
585 git for-each-ref --format='%(objectname)' "[r]efs/${ref#refs/}"
592 *) fail "t-git-get-ref bad $ref" ;;
594 (git show-ref -d $1 || test $? = 1) | perl -ne '
595 $x = $1 if m#^(\w+) \Q'$1'\E(?:\^\{\})?$#;
596 END { print "$x\n" if length $x; }
600 t-ref-same-exact () {
602 local val; val=`t-git-get-ref-exact $name`
603 t-ref-same-val "$name" $val
608 local val; val=`t-git-get-ref $name`
609 t-ref-same-val "$name" $val
613 local val; val=`git rev-parse HEAD`
614 t-ref-same-val HEAD $val
620 case "${t_ref_val-unset}" in
623 *) fail "ref varies: ($name)\
624 ${val:-nothing} != ${t_ref_val:-nothing} (${t_ref_names[*]})" ;;
627 t_ref_names+=("$name")
630 t-refs-same-start () {
645 val=`t-git-get-ref $g`
646 if [ "x$val" != x ]; then
647 fail "ref $g unexpectedly exists ($val)"
653 echo refs/tags/$tagpfx/${v//\~/_}
657 git log -n1 --pretty=format:"$1" "$2"
660 t-sametree-parent () {
663 local ctree; ctree=$(t-format-ref '%T' "$ref")
666 for parent in $(t-format-ref '%P' "$ref"); do
667 local ptree; ptree=$(t-format-ref '%T' "$parent")
668 if [ "x$ptree" = "x$ctree" ]; then
672 case "$psame" in ""|" * *") break ;; esac
678 t-check-pushed-master () {
679 local master; master=`t-git-get-ref refs/heads/master`
680 if [ x$master = x$t_ref_val ]; then return; fi
681 if [ x$master = x ]; then fail "failed to push master"; fi
682 # didn't update master, it must be not FF
683 local mbase; mbase=`t-git-merge-base $master $t_ref_val`
684 if [ x$mbase = x$master ]; then fail "failed to ff master"; fi
687 t-push-was-source-only () {
689 t-files-notexist $tmp/incoming/${p}_${v}_*.deb \
690 $tmp/incoming/${p}_${v}_*.udeb
691 # we permit _source.buildinfo files; see test_changes_source_only()
692 for f in $tmp/incoming/${p}_${v}_*.buildinfo; do
695 *_source.buildinfo) ;;
696 *) fail "non-source-only file $f exists!" ;;
704 stat $tmp/incoming/$f
710 local suite=${2:-sid}
716 t-pushed-good-core () {
720 refs/remotes/dgit/dgit/$suite
722 refs/heads/dgit/unstable \
723 refs/remotes/dgit/dgit/unstable
724 (set -e; cd $dgitrepo
728 ${t_check_pushed_master:- : NOT-DRS-NO-CHECK-PUSHED-MASTER}
732 git verify-tag `t-v-tag`
735 t-pushed-good-check-changes () {
736 changes_filename="$tmp/incoming/${p}_${v}_*.changes"
737 grep -E "^Distribution: $suite" $changes_filename
738 grep -E "^Version: $v" $changes_filename
741 t-splitbrain-pushed-good--unpack () {
746 ln -s $tmp/mirror/pool/main/*.orig*.tar* .
747 ln -s $tmp/incoming/*.orig*.tar* . ||:
748 ln -s $incoming_dsc .
749 ln -s ${incoming_dsc/.dsc/.debian.tar}* .
750 ln -s ${incoming_dsc/.dsc/.tar}* . ||:
751 dpkg-source "$@" -x *.dsc
754 git fetch ../../$p "refs/tags/*:refs/tags/*"
757 t-splitbrain-pushed-good--checkprep () {
759 git rm --cached -r --ignore-unmatch .pc
762 t-splitbrain-pushed-good--checkdiff () {
764 t-splitbrain-pushed-good--checkprep
765 t-output "" git diff --stat --cached $tag
768 t-splitbrain-pushed-good-start () {
769 dep14tag=refs/tags/test-dummy/${v//\~/_}
771 t-output "" git status --porcelain
773 t-refs-same $dep14tag
774 (set -e; cd $dgitrepo; t-refs-same $dep14tag)
775 git merge-base --is-ancestor $dep14tag $dgittag
778 t-ref-same refs/heads/split.p
779 case "$(t-git-get-ref refs/heads/split.b)" in
781 "$(git rev-parse refs/heads/split.p^0)") ;;
782 "$(git rev-parse refs/heads/split.p^1)") ;;
789 t-splitbrain-pushed-good--unpack
790 t-splitbrain-pushed-good--checkdiff $dgittag
792 t-splitbrain-pushed-good-end-made-dep14 () {
793 t-splitbrain-pushed-good--checkdiff $dep14tag
797 t-splitbrain-rm-1-patch () {
800 next unless $_ eq "'"$patchname"'\n";
803 rename "debian/patches/$_", "../t-'"$patchname"'" or die $!;
805 ' debian/patches/series
808 t-splitbrain-rm-gitignore-patch () {
809 t-splitbrain-rm-1-patch auto-gitignore
812 t-gbp-pushed-good () {
813 local suite=${1:-sid}
814 t-splitbrain-pushed-good-start
816 # Right, now we want to check that the maintainer tree and
817 # the dgit tree differ in exactly the ways we expect. We
818 # achieve this by trying to reconstruct the maintainer tree
819 # from the dgit tree.
821 # So, unpack it withut the patches applied
822 t-splitbrain-pushed-good--unpack --skip-patches
824 # dgit might have added a .gitignore patch, which we need to
826 t-splitbrain-rm-gitignore-patch
828 # Now the result should differ only in non-debian/ .gitignores
829 t-splitbrain-pushed-good--checkprep
830 git diff --cached --name-only $dep14tag >../changed
832 next if !m#^debian/# && m#(^|/)\.gitignore#;
836 # If we actually apply the gitignore patch by hand, it
838 if [ -f ../t-auto-gitignore ]; then
839 patch --backup-if-mismatch -p1 -u <../t-auto-gitignore
842 t-splitbrain-pushed-good-end-made-dep14
845 t-unapplied-pushed-good () {
846 local suite=${1:-sid}
847 t-splitbrain-pushed-good-start
848 t-splitbrain-pushed-good--unpack --skip-patches
849 t-splitbrain-pushed-good-end-made-dep14
852 t-dpm-pushed-good () {
853 local suite=${1:-sid}
854 t-splitbrain-pushed-good-start
855 t-splitbrain-pushed-good--unpack
856 t-splitbrain-rm-gitignore-patch
857 t-splitbrain-pushed-good-end-made-dep14
860 t-split-unchanged-pushed-good () {
861 local suite=${1:-sid}
862 t-splitbrain-pushed-good-start
863 t-splitbrain-pushed-good--unpack
864 t-splitbrain-pushed-good-end-made-dep14
867 t-commit-build-push-expect-log () {
873 t-dgit push --new 2>&1 |tee $tmp/push.log
874 t-grep-mpat "$mpat" $tmp/push.log
881 use Dpkg::Control::Hash;
882 my $h = new Dpkg::Control::Hash allow_pgp=>1;
883 $h->parse(\*STDIN,"'"$file"'");
884 my $val = $h->{"'$field'"},"\n";
885 die "'"$file $field"'" unless defined $val;
891 export DGIT_TEST_DISTRO=''
893 t-git-config dgit-suite.unstable.distro test-dummy
903 "") '$var'="$tstunt" ;;
904 *) '$var'="$tstunt:$'$var'" ;;
910 t-tstunt--save-real () {
921 p="${p/:"$tmp/tstunt":/:}"
933 *) fail "did not find $f on PATH $PATH" ;;
936 local varname=${f//[^_0-9a-zA-Z]/_}
937 varname=DGIT_TEST_REAL_${varname^^}
940 : \${$varname:=\$real}
946 local tstunt=$tmp/tstunt
947 t-stunt-envvar PATH $tstunt
948 t-stunt-envvar PERLLIB $tstunt
951 t-tstunt--save-real $f
953 local d="$tstunt/${f%/*}"
955 ln -sf "$troot/tstunt/$f" "$d"/.
959 t-tstunt-parsechangelog () {
960 t-tstunt dpkg-parsechangelog Dpkg/Changelog/Parse.pm
963 t-tstunt-lintian () {
967 t-tstunt-debuild () {
972 local dsc=${p}_${v}.dsc
973 incoming_dsc=$tmp/incoming/$dsc
978 local val; val=`t-822-field $incoming_dsc Dgit`
981 die "Dgit $_ ?" unless m/^\w+\b/;
982 print $&,"\n" or die $!;
984 t-ref-same-val $incoming_dsc "$val"
991 debdiff ${p}_${v1}.dsc ${p}_${v2}.dsc || test $? = 1) \
995 t-gbp-unapplied-pq2qc () {
996 # does `gbp pq export'
997 # commits the resulting debian/patches on qc/BRANCH
998 # leaves us on qc/BRANCH (eg "qc/quilt-tip"))
999 # qc/BRANCH is not fast-forwarding
1003 branch=`git symbolic-ref HEAD`
1004 branch=${branch#refs/heads/}
1007 */*) fail "unexpected branch $branch" ;;
1010 git branch -f qc/$branch
1011 git checkout qc/$branch
1012 git add debian/patches
1013 git commit -m 'Commit patch queue'
1016 t-git-pseudo-merge () {
1017 # like git merge -s ours
1018 if [ ! "$git_pseuomerge_opts" ]; then
1019 if git merge --help \
1020 | grep -q allow-unrelated-histories; then
1021 git_pseuomerge_opts='--allow-unrelated-histories'
1023 git_pseuomerge_opts+=' -s ours'
1025 git merge $git_pseuomerge_opts "$@"
1028 t-gbp-example-prep-no-ff () {
1029 t-tstunt-parsechangelog
1030 t-archive example 1.0-1
1038 git checkout -b patch-queue/quilt-tip-2 patch-queue/quilt-tip
1041 echo '/* some comment */' >>src.c
1043 git commit -m 'Add a comment to an upstream file'
1045 t-gbp-unapplied-pq2qc
1047 t-commit 'some updates' 1.0-2
1050 t-gbp-example-prep () {
1051 t-gbp-example-prep-no-ff
1053 t-git-pseudo-merge \
1054 -m 'Pseudo-merge to make descendant of archive' \
1055 remotes/dgit/dgit/sid
1058 t-make-badcommit () {
1060 git cat-file commit HEAD | \
1061 perl -pe 's/^committer /commiter /' | \
1062 git hash-object -w -t commit --stdin
1064 t-expect-fsck-fail $badcommit
1068 # leaves ust set to filename of orig tarball
1072 ust=${p}_${v}.orig.tar.gz
1073 GZIP=-1 git archive -o $bpd/$ust --prefix=${p}-${v}/ $tag
1076 t-merge-conflicted-stripping-conflict-markers () {
1077 local otherbranch=$1
1080 t-expect-fail F:"Merge conflict in $file" \
1081 git merge $otherbranch
1083 perl -i~ -ne 'print unless m{^(?:\<\<\<|\>\>\>|===)}' "$file"
1085 git commit --no-edit
1090 v=${2:-${majorv:-1}.$revision}
1091 $troot/tstunt/debchange \
1092 --force-distribution -v$v --distribution ${3:-unstable} "$1"
1093 git add debian/changelog
1095 revision=$(( ${revision-0} + 1 ))
1099 local cmd="$1"; shift
1100 local suite=${1-unstable}
1101 $cmd -r -D "$suite" ''
1105 t-dch-r-rune t-dch-commit "$@"
1109 $troot/tstunt/debchange "$@"
1110 git commit -m "dch $*" debian/changelog
1114 git config --global "$@"
1118 t-git-config dgit-distro.test-dummy.git-url "ext::$troot/drs-git-ext %S "
1119 t-git-config dgit-distro.test-dummy.git-check true
1120 t-git-config dgit-distro.test-dummy.git-create true
1121 cp $troot/gnupg/{dd.gpg,dm.gpg,dm.txt} $tmp/.
1122 cp $troot/suites $tmp/.
1123 cp $troot/suites $tmp/suites-master
1125 export t_check_pushed_master=t-check-pushed-master
1127 drs_dispatch=$tmp/distro=test-dummy
1130 if [ "x$DGIT_TEST_INTREE" != x ]; then
1131 ln -sf "$DGIT_TEST_INTREE" $drs_dispatch/dgit-live
1134 ln -sf $tmp/git $drs_dispatch/repos
1135 ln -sf $tmp/suites $tmp/suites-master $tmp/dm.txt $drs_dispatch/
1136 mkdir -p $drs_dispatch/keyrings
1137 ln -sf $tmp/dd.gpg $drs_dispatch/keyrings/debian-keyring.gpg
1138 ln -sf $tmp/dm.gpg $drs_dispatch/keyrings/debian-maintainers.gpg
1139 ln -sf /bin/true $drs_dispatch/policy-hook
1144 t-git-config dgit-distro.test-dummy.ssh "$troot/dsd-ssh"
1145 t-git-config dgit-distro.test-dummy.git-check ssh-cmd
1146 t-git-config dgit-distro.test-dummy.git-create true
1147 t-git-config dgit-distro.test-dummy.git-url \
1148 "ext::$troot/dsd-ssh X %S /dgit/test-dummy/repos"
1150 t-git-config dgit-distro.test-dummy.diverts.drs /drs
1151 t-git-config dgit-distro.test-dummy/drs.ssh "$troot/ssh"
1152 t-git-config dgit-distro.test-dummy/drs.git-url $tmp/git
1153 t-git-config dgit-distro.test-dummy/drs.git-check ssh-cmd
1154 t-git-config dgit-distro.test-dummy/drs.git-create ssh-cmd
1156 echo 'no-such-package* drs' >$drs_dispatch/diverts
1160 : '(((((((((((((((((((((((((((((((((((((((('
1161 ${DGIT_INFRA_PFX}dgit-repos-admin-debian --repos $tmp/git "$@"
1162 : '))))))))))))))))))))))))))))))))))))))))'
1165 t-policy-nonexist () {
1166 ln -sf no-such-file-or-directory $drs_dispatch/policy-hook
1169 t-make-hook-link () {
1170 local hook=$1 # in infra/
1172 hook=${DGIT_INFRA_PFX}$hook
1175 *) hook=`type -P $hook` ;;
1177 ln -sf "$hook" $linkpath
1182 t-make-hook-link $policyhook $drs_dispatch/policy-hook
1187 t-policy dgit-repos-policy-debian
1190 t-policy-admin create-db
1193 t-policy-periodic () {
1194 : '(((((((((((((((((((((((((((((((((((((((('
1195 ${DGIT_REPOS_SERVER_TEST-dgit-repos-server} \
1196 test-dummy $drs_dispatch '' --cron
1197 : '))))))))))))))))))))))))))))))))))))))))'
1200 t-tagupl-settings () {
1201 export DGIT_DRS_EMAIL_NOREPLY=noreply@example.org
1202 export DGIT_DRS_SENDMAIL=$troot/tstunt/sendmail
1203 export DGIT_DRS_DGIT=$troot/tstunt/dgit
1204 t-chain-test-somehow
1207 t-tagupl-run-drs () {
1211 DGIT_DRS_ANY_URL=1 \
1212 DGIT_DRS_MODE="tag2upload $tmp/$p $tagname" \
1219 ${DGIT_DEBPUSH_TEST-git debpush} \
1220 --distro=test-dummy --no-push -u Senatus "$@"
1226 t-pushed-good master
1229 t-buildproductsdir-config () {
1231 t-git-config dgit.default.build-products-dir $bpd
1233 cat <<END >>$tmp/.gbp.conf
1240 local restriction=$1
1241 (cd $root; t-restriction-$restriction >&2)
1245 : "Hopefully installed: $*"
1248 t-chain-test-somehow () {
1249 export DGIT_TEST_TESTNAME="$testname"
1250 export DGIT_TEST_TMPBASE="$tmpbase"
1255 t-chain-test-somehow
1265 t-chain-test "${t#*-}"
1268 t-git-config dgit.default.old-dsc-distro test-dummy
1270 for import in ${autoimport-gnupg}; do
1274 t-setup-import $import