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
47 testname="${DGIT_TEST_TESTNAME-${0##*/}}"
48 export DGIT_TEST_TROOT=$troot
52 if [ x"$tmp" = x ]; then
53 export DGIT_TEST_BYHAND=1
56 tmp=tests/tmp/$testname
59 elif [ "x$DGIT_TEST_TMPBASE" != x ]; then
60 tmpbase="$DGIT_TEST_TMPBASE"
68 test -f $tmp/.save-env || \
69 env -0 >$tmp/.save-env
73 export DEBCHANGE_VENDOR=dpkg
77 mkdir -p $tmp/incoming
78 cat <<END >$tmp/dput.cf
81 incoming = $tmp/incoming
85 schroot=${DGIT_SCHROOT_CHROOT:-build}
86 # Pretty much any Debian sid snapshot schroot will do.
88 : ${t_archive_method:=aq}
89 : ${tagpfx:=archive/test-dummy}
90 : ${suitespecs:=sid:unstable}
93 GIT_COMMITTER_DATE="$(( ${GIT_COMMITTER_DATE%% *} + 1 )) ${GIT_COMMITTER_DATE#* }"
94 GIT_AUTHOR_DATE="$GIT_COMMITTER_DATE"
98 local mpat="$1"; shift
101 LC_MESSAGES=${expect_fail_lcmessages-C} \
102 LANGUAGE=${expect_fail_lcmessages-C} \
103 "$@" 2>&1 | tee $tmp/t.output
104 local ps="${PIPESTATUS[*]}"
108 "0 0") fail "command unexpectedly succeeded (instead of: $mpat)" ;;
110 *) fail "tee failed" ;;
113 t-grep-mpat "$mpat" $tmp/t.output
124 E:*) grepper=egrep ;;
125 F:*) grepper=fgrep ;;
126 *) fail "bad mpat prefix in $mpat";;
132 $grepper -e "$mpat" "$file" ||
133 fail "message not found"
136 t-expect-push-fail () {
137 local mpat="$1"; shift
139 local triedpush; triedpush=`git rev-parse HEAD`
142 t-expect-fail "$mpat" "$@"
144 diff $tmp/show-refs.{pre,post}-push
146 t-git-objects-not-present '' $triedpush
148 eval "$t_expect_push_fail_hook"
151 t-git-objects-not-present () {
152 # t-git-objects-not-present GITDIR|'' OBJID [...]
153 # specifying '' means the repo for package $p
154 local gitdir="${1-$dgitrepo}"
156 if ! [ -e "$gitdir" ]; then return; fi
159 t-expect-fail 'unable to find' \
165 local whichoutput=$1; shift
166 local whichrepo=${1-$dgitrepo}
167 local outputfile="$tmp/show-refs.$whichoutput"
170 if test -d $whichrepo; then
178 local edittree=$1.edit
179 if test -d "$edittree"; then
180 cp -a "$edittree"/* .
188 t-untar $troot/worktrees/${p}_$1
191 t-select-package () {
193 dgitrepo=$tmp/git/$p.git
200 local gs=$troot/git-srcs/${p}_$v.git
201 (set -e; cd $tmp/git; t-untar $gs)
206 (set -e; cd $tmp/git; tar xf $troot/git-template.tar)
209 t-salsa-add-remote () {
210 local d=$tmp/salsa/$p
212 (set -e; cd $d; git init --bare)
213 git remote add ${1-origin} $d
216 t-git-merge-base () {
217 git merge-base $1 $2 || test $? = 1
221 # t-has-ancestor ANCESTOR
222 # (CHILD is implicit, HEAD)
223 local now; now=`git rev-parse HEAD`
224 local ancestor; ancestor=`git rev-parse $1^{}`
225 local mbase; mbase=`t-git-merge-base $ancestor $now`
226 if [ x$mbase != x$ancestor ]; then
227 fail "not ff $ancestor..$now, $mbase != $ancestor"
231 t-has-parent-or-is () {
232 # t-has-parent-or-is CHILD PARENT
236 parents=$(git show --pretty=format:' %P %H ' "$child")
237 parent=$(git rev-parse "$parent~0")
240 *) fail "child $child lacks parent $parent" ;;
244 t-prep-newpackage () {
251 if ! git show-ref --verify --quiet refs/heads/master; then
252 git branch -m dgit/sid master
260 t-archive-none-$t_archive_method
262 t-archive-none-aq () {
263 mkdir -p $tmp/aq/dsc_in_suite $tmp/mirror/pool/main
269 for suitespec in $suitespecs; do
270 local suite=${suitespec%%:*}
271 local sname=${suitespec#*:}
273 >$tmp/aq/package.$suite.$p
274 t-aq-archive-updated $suite $p
276 >$tmp/aq/package.new.$p
277 t-aq-archive-updated new $p
279 ln -sf $suite $tmp/aq/dsc_in_suite/$sname
281 cat <<END >>$tmp/aq/suites
284 "archive" : "ftp-master",
285 "codename" : "$suite",
298 cat <<END >>$tmp/aq/suites
304 t-aq-archive-updated () {
307 local suitedir=$tmp/aq/dsc_in_suite/$suite
309 perl <$tmp/aq/package.$suite.$p >$suitedir/$p -wne '
313 m{^(\S+) (\w+) ([^ \t/]+)/(\S+)} or die;
321 my $json = JSON->new->canonical();
322 print $json->encode(\@v) or die $!;
327 t-archive-process-incoming () {
329 mv $tmp/incoming/${p}_* $tmp/mirror/pool/main/
330 t-archive-query "$suite"
335 local dscf=main/${p}_${v}.dsc
336 t-archive-query-$t_archive_method "$suite" "$p" "$v" "$dscf"
338 t-archive-query-aq () {
343 local sha; sha=`sha256sum <$tmp/mirror/pool/$dscf`
344 echo "${v} ${sha% -} $dscf" >>$tmp/aq/package.$suite.${p}
345 t-aq-archive-updated $suite $p
351 local dscf=${p}_$2.dsc
352 rm -f $tmp/mirror/pool/main/${p}_*
353 ln -s $troot/pkg-srcs/${p}_${2%-*}* $tmp/mirror/pool/main/
354 t-archive-query $suite
357 (set -e; cd $tmp/extract; dpkg-source -x ../mirror/pool/main/$dscf)
360 t-git-dir-time-passes () {
361 touch -d 'last year' $dgitrepo
365 local gitdir=$dgitrepo
368 if test -e "$gitdir"; then fail "$gitdir exists"; fi
371 public) wantstat='7[75]5' ;;
372 secret) wantstat='7[70]0' ;;
373 *) fail "$1 t-git-dir-check ?" ;;
375 gotstat=`stat -c%a $gitdir`
377 *$wantstat) return ;;
378 *) fail "$gitdir has mode $gotstat, expected $wantstat" ;;
382 t-expect-fsck-fail () {
383 echo >>$tmp/fsck.expected-errors "$1"
387 local fsckerrs=$(git rev-parse --git-dir)/dgit-test-fsck.errs
390 LC_MESSAGES=C git fsck --no-dangling --strict 2>&1 \
392 ps="${PIPESTATUS[*]}"
396 if [ -f $tmp/fsck.expected-errors ]; then
397 pats=(-w -f $tmp/fsck.expected-errors)
401 pats+=(-e 'notice: HEAD points to an unborn branch')
402 pats+=(-e 'notice: No default references')
405 grep -v "${pats[@]}" $fsckerrs
409 1) ;; # no unexpected errors
410 0) fail "unexpected messages from git-fsck" ;;
411 *) fail "grep of git-fsck failed" ;;
415 t-check-only-bpd () {
416 if [ "$bpd" = .. ]; then return; fi
418 $tmp/*.{deb,changes,dsc,buildinfo} \
425 for d in $tmp/*/.git $tmp/git/*.git; do
433 : '========================================'
440 t-save-artifacts () {
441 artifacts="$AUTOPKGTEST_ARTIFACTS"
442 if [ x"$artifacts" = x ]; then return; fi
443 if [ x"tmp" = x ]; then return; fi
444 GZIP=-1v tar -C "$tmp" -zc -f "$artifacts/${0##*/}.tar.gz" \
448 t-rm-dput-dropping () {
449 rm -f $tmp/${p}_${v}_*.upload
453 local dgit=${DGIT_TEST-dgit}
456 {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{'
457 $dgit --dgit=$dgit --dget:-u --dput:--config=$tmp/dput.cf \
458 ${dgit_config_debian_alias-"--config-lookup-explode=dgit-distro.debian.alias-canon"} \
459 ${DGIT_GITDEBREBASE_TEST+--git-debrebase=}${DGIT_GITDEBREBASE_TEST} \
460 ${distro+${distro:+-d}}${distro--dtest-dummy} \
461 $DGIT_TEST_OPTS $DGIT_TEST_DEBUG \
462 -kBCD22CD83243B79D3DFAC33EA3DBCBC039B13D8A $t_dgit_xopts "$@"
463 : '}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
470 (export LC_ALL=C.UTF-8
471 if [ "$DGIT_TEST_INTREE" ]; then
472 make -C $DGIT_TEST_INTREE $page.$section.view
479 diff --exclude=.git --exclude=.pc -ruN $*
482 t-files-notexist () {
491 t-cloned-fetched-good () {
492 t-diff-nogit ../extract/$p-${v%-*} .
493 t-clean-on-branch dgit/sid
496 refs/heads/dgit/sid \
497 refs/remotes/dgit/dgit/sid
498 t-refs-notexist refs/dgit/unstable refs/remotes/dgit/dgit/unstable
502 printf "%s${1:+\n}" "$1" >$tmp/t.want
505 diff $tmp/t.want $tmp/t.got
508 t-clean-on-branch () {
509 t-output "## $1" git status -b --porcelain
517 local import=IMPORT.${DGIT_TEST_TESTNAME-${0##*/}}
518 exec 4>$tmp/$import.new
521 for vn in $savevars; do
522 perl >&4 -"I$root" -MDebian::Dgit -e '
523 printf "%s=%s\n", $ARGV[0], shellquote $ARGV[1]
524 ' $vn "$(eval "printf '%s\n' \"\$$vn\"")"
527 perl >&4 -"I$root" -MDebian::Dgit -we '
528 foreach my $vn (grep m/^DGIT_TEST_REAL_/, keys %ENV) {
529 print STDERR "saving-exporting $vn\n";
530 printf "export %s=%s\n", $vn, shellquote $ENV{$vn}
535 (set -e; cd $tmp; tar cf $import.tar $savedirs)
537 printf >&4 "\n%s\n" "$importeval"
539 mv -f $tmp/$import.new $tmp/$import
547 if [ "x$tmpbase" = x ]; then
548 # ADTTMP was set on entry to tests/lib, so we
549 # are not sharing tmp area between tests
551 lock="$tmp/.dummy.lock"
553 setupsrc="$tmpbase/$setupname"
554 lock="$setupsrc.lock"
557 local simport="$setupsrc/IMPORT.$setupname"
559 if ! [ -e "$simport" ]; then
560 with-lock-ex -w "$lock" \
561 xargs -0 -a $tmp/.save-env \
564 setupname="$1"; shift
566 if [ -e "$simport" ]; then exit 0; fi
568 "tests/setup/$setupname"
569 ' x "$root" "$setupname" "$simport"
572 if [ "x$setupsrc" != "x$tmp" ]; then
573 (set -e; cd $tmp; tar xf "$simport.tar")
579 t-git-get-ref-exact () {
581 # does not dereference, unlike t-git-get-ref
584 *) fail "t-git-get-ref-exact bad $ref" ;;
586 git for-each-ref --format='%(objectname)' "[r]efs/${ref#refs/}"
593 *) fail "t-git-get-ref bad $ref" ;;
595 (git show-ref -d $1 || test $? = 1) | perl -ne '
596 $x = $1 if m#^(\w+) \Q'$1'\E(?:\^\{\})?$#;
597 END { print "$x\n" if length $x; }
601 t-ref-same-exact () {
603 local val; val=`t-git-get-ref-exact $name`
604 t-ref-same-val "$name" $val
609 local val; val=`t-git-get-ref $name`
610 t-ref-same-val "$name" $val
614 local val; val=`git rev-parse HEAD`
615 t-ref-same-val HEAD $val
621 case "${t_ref_val-unset}" in
624 *) fail "ref varies: ($name)\
625 ${val:-nothing} != ${t_ref_val:-nothing} (${t_ref_names[*]})" ;;
628 t_ref_names+=("$name")
631 t-refs-same-start () {
646 val=`t-git-get-ref $g`
647 if [ "x$val" != x ]; then
648 fail "ref $g unexpectedly exists ($val)"
654 echo refs/tags/$tagpfx/${v//\~/_}
658 git log -n1 --pretty=format:"$1" "$2"
661 t-sametree-parent () {
664 local ctree; ctree=$(t-format-ref '%T' "$ref")
667 for parent in $(t-format-ref '%P' "$ref"); do
668 local ptree; ptree=$(t-format-ref '%T' "$parent")
669 if [ "x$ptree" = "x$ctree" ]; then
673 case "$psame" in ""|" * *") break ;; esac
679 t-check-pushed-master () {
680 local master; master=`t-git-get-ref refs/heads/master`
681 if [ x$master = x$t_ref_val ]; then return; fi
682 if [ x$master = x ]; then fail "failed to push master"; fi
683 # didn't update master, it must be not FF
684 local mbase; mbase=`t-git-merge-base $master $t_ref_val`
685 if [ x$mbase = x$master ]; then fail "failed to ff master"; fi
688 t-push-was-source-only () {
690 t-files-notexist $tmp/incoming/${p}_${v}_*.deb \
691 $tmp/incoming/${p}_${v}_*.udeb
692 # we permit _source.buildinfo files; see test_changes_source_only()
693 for f in $tmp/incoming/${p}_${v}_*.buildinfo; do
696 *_source.buildinfo) ;;
697 *) fail "non-source-only file $f exists!" ;;
705 stat $tmp/incoming/$f
711 local suite=${2:-sid}
717 t-pushed-good-core () {
721 refs/remotes/dgit/dgit/$suite
723 refs/heads/dgit/unstable \
724 refs/remotes/dgit/dgit/unstable
725 (set -e; cd $dgitrepo
729 ${t_check_pushed_master:- : NOT-DRS-NO-CHECK-PUSHED-MASTER}
733 git verify-tag `t-v-tag`
736 t-pushed-good-check-changes () {
737 changes_filename="$tmp/incoming/${p}_${v}_*.changes"
738 grep -E "^Distribution: $suite" $changes_filename
739 grep -E "^Version: $v" $changes_filename
742 t-splitbrain-pushed-good--unpack () {
747 ln -s $tmp/mirror/pool/main/*.orig*.tar* .
748 ln -s $tmp/incoming/*.orig*.tar* . ||:
749 ln -s $incoming_dsc .
750 ln -s ${incoming_dsc/.dsc/.debian.tar}* .
751 ln -s ${incoming_dsc/.dsc/.tar}* . ||:
752 dpkg-source "$@" -x *.dsc
755 git fetch ../../$p "refs/tags/*:refs/tags/*"
758 t-splitbrain-pushed-good--checkprep () {
760 git rm --cached -r --ignore-unmatch .pc
763 t-splitbrain-pushed-good--checkdiff () {
765 t-splitbrain-pushed-good--checkprep
766 t-output "" git diff --stat --cached $tag
769 t-splitbrain-pushed-good-start () {
770 dep14tag=refs/tags/test-dummy/${v//\~/_}
772 t-output "" git status --porcelain
774 t-refs-same $dep14tag
775 (set -e; cd $dgitrepo; t-refs-same $dep14tag)
776 git merge-base --is-ancestor $dep14tag $dgittag
779 t-ref-same refs/heads/split.p
780 local split_b=$(t-git-get-ref refs/heads/split.b)
783 "$(git rev-parse refs/heads/split.p^0)") ;;
784 "$(git rev-parse refs/heads/split.p^1)") ;;
785 *) fail "bad b/p (b=$split_b)" ;;
791 t-splitbrain-pushed-good--unpack
792 t-splitbrain-pushed-good--checkdiff $dgittag
794 t-splitbrain-pushed-good-end-made-dep14 () {
795 t-splitbrain-pushed-good--checkdiff $dep14tag
799 t-splitbrain-rm-1-patch () {
802 next unless $_ eq "'"$patchname"'\n";
805 rename "debian/patches/$_", "../t-'"$patchname"'" or die $!;
807 ' debian/patches/series
810 t-splitbrain-rm-gitignore-patch () {
811 t-splitbrain-rm-1-patch auto-gitignore
814 t-gbp-pushed-good () {
815 local suite=${1:-sid}
816 t-splitbrain-pushed-good-start
818 # Right, now we want to check that the maintainer tree and
819 # the dgit tree differ in exactly the ways we expect. We
820 # achieve this by trying to reconstruct the maintainer tree
821 # from the dgit tree.
823 # So, unpack it withut the patches applied
824 t-splitbrain-pushed-good--unpack --skip-patches
826 # dgit might have added a .gitignore patch, which we need to
828 t-splitbrain-rm-gitignore-patch
830 # Now the result should differ only in non-debian/ .gitignores
831 t-splitbrain-pushed-good--checkprep
832 git diff --cached --name-only $dep14tag >../changed
834 next if !m#^debian/# && m#(^|/)\.gitignore#;
838 # If we actually apply the gitignore patch by hand, it
840 if [ -f ../t-auto-gitignore ]; then
841 patch --backup-if-mismatch -p1 -u <../t-auto-gitignore
844 t-splitbrain-pushed-good-end-made-dep14
847 t-unapplied-pushed-good () {
848 local suite=${1:-sid}
849 t-splitbrain-pushed-good-start
850 t-splitbrain-pushed-good--unpack --skip-patches
851 t-splitbrain-pushed-good-end-made-dep14
854 t-dpm-pushed-good () {
855 local suite=${1:-sid}
856 t-splitbrain-pushed-good-start
857 t-splitbrain-pushed-good--unpack
858 t-splitbrain-rm-gitignore-patch
859 t-splitbrain-pushed-good-end-made-dep14
862 t-split-unchanged-pushed-good () {
863 local suite=${1:-sid}
864 t-splitbrain-pushed-good-start
865 t-splitbrain-pushed-good--unpack
866 t-splitbrain-pushed-good-end-made-dep14
869 t-commit-build-push-expect-log () {
875 t-dgit push --new 2>&1 |tee $tmp/push.log
876 t-grep-mpat "$mpat" $tmp/push.log
883 use Dpkg::Control::Hash;
884 my $h = new Dpkg::Control::Hash allow_pgp=>1;
885 $h->parse(\*STDIN,"'"$file"'");
886 my $val = $h->{"'$field'"},"\n";
887 die "'"$file $field"'" unless defined $val;
893 export DGIT_TEST_DISTRO=''
895 t-git-config dgit-suite.unstable.distro test-dummy
905 "") '$var'="$tstunt" ;;
906 *) '$var'="$tstunt:$'$var'" ;;
912 t-tstunt--save-real () {
923 p="${p/:"$tmp/tstunt":/:}"
935 *) fail "did not find $f on PATH $PATH" ;;
938 local varname=${f//[^_0-9a-zA-Z]/_}
939 varname=DGIT_TEST_REAL_${varname^^}
942 : \${$varname:=\$real}
948 local tstunt=$tmp/tstunt
949 t-stunt-envvar PATH $tstunt
950 t-stunt-envvar PERLLIB $tstunt
953 t-tstunt--save-real $f
955 local d="$tstunt/${f%/*}"
957 ln -sf "$troot/tstunt/$f" "$d"/.
961 t-tstunt-parsechangelog () {
962 t-tstunt dpkg-parsechangelog Dpkg/Changelog/Parse.pm
965 t-tstunt-lintian () {
969 t-tstunt-debuild () {
974 local dsc=${p}_${v}.dsc
975 incoming_dsc=$tmp/incoming/$dsc
980 local val; val=`t-822-field $incoming_dsc Dgit`
983 die "Dgit $_ ?" unless m/^\w+\b/;
984 print $&,"\n" or die $!;
986 t-ref-same-val $incoming_dsc "$val"
993 debdiff ${p}_${v1}.dsc ${p}_${v2}.dsc || test $? = 1) \
997 t-gbp-unapplied-pq2qc () {
998 # does `gbp pq export'
999 # commits the resulting debian/patches on qc/BRANCH
1000 # leaves us on qc/BRANCH (eg "qc/quilt-tip"))
1001 # qc/BRANCH is not fast-forwarding
1005 branch=`git symbolic-ref HEAD`
1006 branch=${branch#refs/heads/}
1009 */*) fail "unexpected branch $branch" ;;
1012 git branch -f qc/$branch
1013 git checkout qc/$branch
1014 git add debian/patches
1015 git commit -m 'Commit patch queue'
1018 t-git-pseudo-merge () {
1019 # like git merge -s ours
1020 if [ ! "$git_pseuomerge_opts" ]; then
1021 if git merge --help \
1022 | grep -q allow-unrelated-histories; then
1023 git_pseuomerge_opts='--allow-unrelated-histories'
1025 git_pseuomerge_opts+=' -s ours'
1027 git merge $git_pseuomerge_opts "$@"
1030 t-gbp-example-prep-no-ff () {
1031 t-archive example 1.0-1
1039 git checkout -b patch-queue/quilt-tip-2 patch-queue/quilt-tip
1042 echo '/* some comment */' >>src.c
1044 git commit -m 'Add a comment to an upstream file'
1046 t-gbp-unapplied-pq2qc
1048 t-commit 'some updates' 1.0-2
1051 t-gbp-example-prep () {
1052 t-gbp-example-prep-no-ff
1054 t-git-pseudo-merge \
1055 -m 'Pseudo-merge to make descendant of archive' \
1056 remotes/dgit/dgit/sid
1059 t-make-badcommit () {
1061 git cat-file commit HEAD | \
1062 perl -pe 's/^committer /commiter /' | \
1063 git hash-object -w -t commit --stdin
1065 t-expect-fsck-fail $badcommit
1069 # leaves ust set to filename of orig tarball
1073 ust=${p}_${v}.orig.tar.gz
1074 GZIP=-1 git archive -o $bpd/$ust --prefix=${p}-${v}/ $tag
1077 t-merge-conflicted-stripping-conflict-markers () {
1078 local otherbranch=$1
1081 t-expect-fail F:"Merge conflict in $file" \
1082 git merge $otherbranch
1084 perl -i~ -ne 'print unless m{^(?:\<\<\<|\>\>\>|===)}' "$file"
1086 git commit --no-edit
1091 v=${2:-${majorv:-1}.$revision}
1092 $troot/tstunt/debchange \
1093 --force-distribution -v$v --distribution ${3:-unstable} "$1"
1094 git add debian/changelog
1096 revision=$(( ${revision-0} + 1 ))
1100 local cmd="$1"; shift
1101 local suite=${1-unstable}
1102 $cmd -r -D "$suite" ''
1106 t-dch-r-rune t-dch-commit "$@"
1110 $troot/tstunt/debchange "$@"
1111 git commit -m "dch $*" debian/changelog
1115 git config --global "$@"
1119 t-git-config dgit-distro.test-dummy.git-url "ext::$troot/drs-git-ext %S "
1120 t-git-config dgit-distro.test-dummy.git-check true
1121 t-git-config dgit-distro.test-dummy.git-create true
1122 cp $troot/gnupg/{dd.gpg,dm.gpg,dm.txt} $tmp/.
1123 cp $troot/suites $tmp/.
1124 cp $troot/suites $tmp/suites-master
1126 export t_check_pushed_master=t-check-pushed-master
1128 drs_dispatch=$tmp/distro=test-dummy
1131 if [ "x$DGIT_TEST_INTREE" != x ]; then
1132 ln -sf "$DGIT_TEST_INTREE" $drs_dispatch/dgit-live
1135 ln -sf $tmp/git $drs_dispatch/repos
1136 ln -sf $tmp/suites $tmp/suites-master $tmp/dm.txt $drs_dispatch/
1137 mkdir -p $drs_dispatch/keyrings
1138 ln -sf $tmp/dd.gpg $drs_dispatch/keyrings/debian-keyring.gpg
1139 ln -sf $tmp/dm.gpg $drs_dispatch/keyrings/debian-maintainers.gpg
1140 ln -sf /bin/true $drs_dispatch/policy-hook
1145 t-git-config dgit-distro.test-dummy.ssh "$troot/dsd-ssh"
1146 t-git-config dgit-distro.test-dummy.git-check ssh-cmd
1147 t-git-config dgit-distro.test-dummy.git-create true
1148 t-git-config dgit-distro.test-dummy.git-url \
1149 "ext::$troot/dsd-ssh X %S /dgit/test-dummy/repos"
1151 t-git-config dgit-distro.test-dummy.diverts.drs /drs
1152 t-git-config dgit-distro.test-dummy/drs.ssh "$troot/ssh"
1153 t-git-config dgit-distro.test-dummy/drs.git-url $tmp/git
1154 t-git-config dgit-distro.test-dummy/drs.git-check ssh-cmd
1155 t-git-config dgit-distro.test-dummy/drs.git-create ssh-cmd
1157 echo 'no-such-package* drs' >$drs_dispatch/diverts
1161 : '(((((((((((((((((((((((((((((((((((((((('
1162 ${DGIT_INFRA_PFX}dgit-repos-admin-debian --repos $tmp/git "$@"
1163 : '))))))))))))))))))))))))))))))))))))))))'
1166 t-policy-nonexist () {
1167 ln -sf no-such-file-or-directory $drs_dispatch/policy-hook
1170 t-make-hook-link () {
1171 local hook=$1 # in infra/
1173 hook=${DGIT_INFRA_PFX}$hook
1176 *) hook=`type -P $hook` ;;
1178 ln -sf "$hook" $linkpath
1183 t-make-hook-link $policyhook $drs_dispatch/policy-hook
1188 t-policy dgit-repos-policy-debian
1191 t-policy-admin create-db
1194 t-policy-periodic () {
1195 : '(((((((((((((((((((((((((((((((((((((((('
1196 ${DGIT_REPOS_SERVER_TEST-dgit-repos-server} \
1197 test-dummy $drs_dispatch '' --cron
1198 : '))))))))))))))))))))))))))))))))))))))))'
1201 t-tagupl-settings () {
1202 export DGIT_DRS_EMAIL_NOREPLY=noreply@example.org
1203 export DGIT_DRS_SENDMAIL=$troot/tstunt/sendmail
1204 export DGIT_DRS_DGIT=$troot/tstunt/dgit
1205 t-chain-test-somehow
1207 mkdir ../pretend-salsa
1208 (set -e; cd ../pretend-salsa; git init --bare)
1209 git remote add salsa $tmp/pretend-salsa
1210 # git branch --set-upstream-to complains, so
1211 git config branch.master.remote salsa
1212 git config branch.master.merge refs/heads/master
1215 t-tagupl-run-drs () {
1220 DGIT_DRS_ANY_URL=1 \
1221 DGIT_DRS_MODE="tag2upload $source $tagname" \
1228 ${DGIT_DEBPUSH_TEST-git debpush} \
1229 --distro=test-dummy -u Senatus "$@"
1232 t-tagupl-run-drs $tmp/pretend-salsa
1235 t-refs-same refs/heads/master
1241 t-buildproductsdir-config () {
1243 t-git-config dgit.default.build-products-dir $bpd
1245 cat <<END >>$tmp/.gbp.conf
1252 local restriction=$1
1253 (cd $root; t-restriction-$restriction >&2)
1257 : "Hopefully installed: $*"
1260 t-chain-test-somehow () {
1261 export DGIT_TEST_TESTNAME="$testname"
1262 export DGIT_TEST_TMPBASE="$tmpbase"
1267 t-chain-test-somehow
1277 t-chain-test "${t#*-}"
1280 t-git-config dgit.default.old-dsc-distro test-dummy
1282 for import in ${autoimport-gnupg}; do
1286 t-setup-import $import