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_DISTRO+ ${distro=${DGIT_TEST_DISTRO}}}
36 export GIT_COMMITTER_DATE='1530000000 +0100'
37 export GIT_AUTHOR_DATE='1530000000 +0100'
39 export LC_CTYPE=C.UTF-8
43 testname="${DGIT_TEST_TESTNAME-${0##*/}}"
44 export DGIT_TEST_TROOT=$troot
48 if [ x"$tmp" = x ]; then
49 export DGIT_TEST_BYHAND=1
52 tmp=tests/tmp/$testname
55 elif [ "x$DGIT_TEST_TMPBASE" != x ]; then
56 tmpbase="$DGIT_TEST_TMPBASE"
64 test -f $tmp/.save-env || \
65 env -0 >$tmp/.save-env
69 export DEBCHANGE_VENDOR=dpkg
73 mkdir -p $tmp/incoming
74 cat <<END >$tmp/dput.cf
77 incoming = $tmp/incoming
81 schroot=${DGIT_SCHROOT_CHROOT:-build}
82 # Pretty much any Debian sid snapshot schroot will do.
84 : ${t_archive_method:=aq}
85 : ${tagpfx:=archive/test-dummy}
86 : ${suitespecs:=sid:unstable}
89 GIT_COMMITTER_DATE="$(( ${GIT_COMMITTER_DATE%% *} + 1 )) ${GIT_COMMITTER_DATE#* }"
90 GIT_AUTHOR_DATE="$GIT_COMMITTER_DATE"
94 local mpat="$1"; shift
97 LC_MESSAGES=${expect_fail_lcmessages-C} \
98 LANGUAGE=${expect_fail_lcmessages-C} \
99 "$@" 2>&1 | tee $tmp/t.output
100 local ps="${PIPESTATUS[*]}"
104 "0 0") fail "command unexpectedly succeeded (instead of: $mpat)" ;;
106 *) fail "tee failed" ;;
109 t-grep-mpat "$mpat" $tmp/t.output
120 E:*) grepper=egrep ;;
121 F:*) grepper=fgrep ;;
122 *) fail "bad mpat prefix in $mpat";;
128 $grepper -e "$mpat" "$file" ||
129 fail "message not found"
132 t-expect-push-fail () {
133 local mpat="$1"; shift
135 local triedpush; triedpush=`git rev-parse HEAD`
138 t-expect-fail "$mpat" "$@"
140 diff $tmp/show-refs.{pre,post}-push
142 t-git-objects-not-present '' $triedpush
144 eval "$t_expect_push_fail_hook"
147 t-git-objects-not-present () {
148 # t-git-objects-not-present GITDIR|'' OBJID [...]
149 # specifying '' means the repo for package $p
150 local gitdir="${1-$dgitrepo}"
152 if ! [ -e "$gitdir" ]; then return; fi
155 t-expect-fail 'unable to find' \
161 local whichoutput=$1; shift
162 local whichrepo=${1-$dgitrepo}
163 local outputfile="$tmp/show-refs.$whichoutput"
166 if test -d $whichrepo; then
174 local edittree=$1.edit
175 if test -d "$edittree"; then
176 cp -a "$edittree"/* .
184 t-untar $troot/worktrees/${p}_$1
187 t-select-package () {
189 dgitrepo=$tmp/git/$p.git
196 local gs=$troot/git-srcs/${p}_$v.git
197 (set -e; cd $tmp/git; t-untar $gs)
202 (set -e; cd $tmp/git; tar xf $troot/git-template.tar)
205 t-salsa-add-remote () {
206 local d=$tmp/salsa/$p
208 (set -e; cd $d; git init --bare)
209 git remote add ${1-origin} $d
212 t-git-merge-base () {
213 git merge-base $1 $2 || test $? = 1
217 # t-has-ancestor ANCESTOR
218 # (CHILD is implicit, HEAD)
219 local now; now=`git rev-parse HEAD`
220 local ancestor; ancestor=`git rev-parse $1^{}`
221 local mbase; mbase=`t-git-merge-base $ancestor $now`
222 if [ x$mbase != x$ancestor ]; then
223 fail "not ff $ancestor..$now, $mbase != $ancestor"
227 t-has-parent-or-is () {
228 # t-has-parent-or-is CHILD PARENT
232 parents=$(git show --pretty=format:' %P %H ' "$child")
233 parent=$(git rev-parse "$parent~0")
236 *) fail "child $child lacks parent $parent" ;;
240 t-prep-newpackage () {
247 if ! git show-ref --verify --quiet refs/heads/master; then
248 git branch -m dgit/sid master
256 t-archive-none-$t_archive_method
258 t-archive-none-aq () {
259 mkdir -p $tmp/aq/dsc_in_suite $tmp/mirror/pool/main
265 for suitespec in $suitespecs; do
266 local suite=${suitespec%%:*}
267 local sname=${suitespec#*:}
269 >$tmp/aq/package.$suite.$p
270 t-aq-archive-updated $suite $p
272 >$tmp/aq/package.new.$p
273 t-aq-archive-updated new $p
275 ln -sf $suite $tmp/aq/dsc_in_suite/$sname
277 cat <<END >>$tmp/aq/suites
280 "archive" : "ftp-master",
281 "codename" : "$suite",
294 cat <<END >>$tmp/aq/suites
300 t-aq-archive-updated () {
303 local suitedir=$tmp/aq/dsc_in_suite/$suite
305 perl <$tmp/aq/package.$suite.$p >$suitedir/$p -wne '
309 m{^(\S+) (\w+) ([^ \t/]+)/(\S+)} or die;
317 my $json = JSON->new->canonical();
318 print $json->encode(\@v) or die $!;
323 t-archive-process-incoming () {
325 mv $tmp/incoming/${p}_* $tmp/mirror/pool/main/
326 t-archive-query "$suite"
331 local dscf=main/${p}_${v}.dsc
332 t-archive-query-$t_archive_method "$suite" "$p" "$v" "$dscf"
334 t-archive-query-aq () {
339 local sha; sha=`sha256sum <$tmp/mirror/pool/$dscf`
340 echo "${v} ${sha% -} $dscf" >>$tmp/aq/package.$suite.${p}
341 t-aq-archive-updated $suite $p
347 local dscf=${p}_$2.dsc
348 rm -f $tmp/mirror/pool/main/${p}_*
349 ln -s $troot/pkg-srcs/${p}_${2%-*}* $tmp/mirror/pool/main/
350 t-archive-query $suite
353 (set -e; cd $tmp/extract; dpkg-source -x ../mirror/pool/main/$dscf)
356 t-git-dir-time-passes () {
357 touch -d 'last year' $dgitrepo
361 local gitdir=$dgitrepo
364 if test -e "$gitdir"; then fail "$gitdir exists"; fi
367 public) wantstat='7[75]5' ;;
368 secret) wantstat='7[70]0' ;;
369 *) fail "$1 t-git-dir-check ?" ;;
371 gotstat=`stat -c%a $gitdir`
373 *$wantstat) return ;;
374 *) fail "$gitdir has mode $gotstat, expected $wantstat" ;;
378 t-expect-fsck-fail () {
379 echo >>$tmp/fsck.expected-errors "$1"
383 local fsckerrs=$(git rev-parse --git-dir)/dgit-test-fsck.errs
386 LC_MESSAGES=C git fsck --no-dangling --strict 2>&1 \
388 ps="${PIPESTATUS[*]}"
392 if [ -f $tmp/fsck.expected-errors ]; then
393 pats=(-w -f $tmp/fsck.expected-errors)
397 pats+=(-e 'notice: HEAD points to an unborn branch')
398 pats+=(-e 'notice: No default references')
401 grep -v "${pats[@]}" $fsckerrs
405 1) ;; # no unexpected errors
406 0) fail "unexpected messages from git-fsck" ;;
407 *) fail "grep of git-fsck failed" ;;
411 t-check-only-bpd () {
412 if [ "$bpd" = .. ]; then return; fi
414 $tmp/*.{deb,changes,dsc,buildinfo} \
421 for d in $tmp/*/.git $tmp/git/*.git; do
429 : '========================================'
436 t-save-artifacts () {
437 artifacts="$AUTOPKGTEST_ARTIFACTS"
438 if [ x"$artifacts" = x ]; then return; fi
439 if [ x"tmp" = x ]; then return; fi
440 GZIP=-1v tar -C "$tmp" -zc -f "$artifacts/${0##*/}.tar.gz" \
444 t-rm-dput-dropping () {
445 rm -f $tmp/${p}_${v}_*.upload
449 local dgit=${DGIT_TEST-dgit}
452 {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{'
453 $dgit --dgit=$dgit --dget:-u --dput:--config=$tmp/dput.cf \
454 ${dgit_config_debian_alias-"--config-lookup-explode=dgit-distro.debian.alias-canon"} \
455 ${DGIT_GITDEBREBASE_TEST+--git-debrebase=}${DGIT_GITDEBREBASE_TEST} \
456 ${distro+${distro:+-d}}${distro--dtest-dummy} \
457 $DGIT_TEST_OPTS $DGIT_TEST_DEBUG \
458 -kBCD22CD83243B79D3DFAC33EA3DBCBC039B13D8A $t_dgit_xopts "$@"
459 : '}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
466 (export LC_ALL=C.UTF-8
467 if [ "$DGIT_TEST_INTREE" ]; then
468 make -C $DGIT_TEST_INTREE $page.$section.view
475 diff --exclude=.git --exclude=.pc -ruN $*
478 t-files-notexist () {
487 t-cloned-fetched-good () {
488 t-diff-nogit ../extract/$p-${v%-*} .
489 t-clean-on-branch dgit/sid
492 refs/heads/dgit/sid \
493 refs/remotes/dgit/dgit/sid
494 t-refs-notexist refs/dgit/unstable refs/remotes/dgit/dgit/unstable
498 printf "%s${1:+\n}" "$1" >$tmp/t.want
501 diff $tmp/t.want $tmp/t.got
504 t-clean-on-branch () {
505 t-output "## $1" git status -b --porcelain
513 local import=IMPORT.${DGIT_TEST_TESTNAME-${0##*/}}
514 exec 4>$tmp/$import.new
517 for vn in $savevars; do
518 perl >&4 -"I$root" -MDebian::Dgit -e '
519 printf "%s=%s\n", $ARGV[0], shellquote $ARGV[1]
520 ' $vn "$(eval "printf '%s\n' \"\$$vn\"")"
523 (set -e; cd $tmp; tar cf $import.tar $savedirs)
525 printf >&4 "\n%s\n" "$importeval"
527 mv -f $tmp/$import.new $tmp/$import
535 if [ "x$tmpbase" = x ]; then
536 # ADTTMP was set on entry to tests/lib, so we
537 # are not sharing tmp area between tests
539 lock="$tmp/.dummy.lock"
541 setupsrc="$tmpbase/$setupname"
542 lock="$setupsrc.lock"
545 local simport="$setupsrc/IMPORT.$setupname"
547 if ! [ -e "$simport" ]; then
548 with-lock-ex -w "$lock" \
549 xargs -0 -a $tmp/.save-env \
552 setupname="$1"; shift
554 if [ -e "$simport" ]; then exit 0; fi
556 "tests/setup/$setupname"
557 ' x "$root" "$setupname" "$simport"
560 if [ "x$setupsrc" != "x$tmp" ]; then
561 (set -e; cd $tmp; tar xf "$simport.tar")
567 t-git-get-ref-exact () {
569 # does not dereference, unlike t-git-get-ref
572 *) fail "t-git-get-ref-exact bad $ref" ;;
574 git for-each-ref --format='%(objectname)' "[r]efs/${ref#refs/}"
581 *) fail "t-git-get-ref bad $ref" ;;
583 (git show-ref -d $1 || test $? = 1) | perl -ne '
584 $x = $1 if m#^(\w+) \Q'$1'\E(?:\^\{\})?$#;
585 END { print "$x\n" if length $x; }
589 t-ref-same-exact () {
591 local val; val=`t-git-get-ref-exact $name`
592 t-ref-same-val "$name" $val
597 local val; val=`t-git-get-ref $name`
598 t-ref-same-val "$name" $val
602 local val; val=`git rev-parse HEAD`
603 t-ref-same-val HEAD $val
609 case "${t_ref_val-unset}" in
612 *) fail "ref varies: ($name)\
613 ${val:-nothing} != ${t_ref_val:-nothing} (${t_ref_names[*]})" ;;
616 t_ref_names+=("$name")
619 t-refs-same-start () {
634 val=`t-git-get-ref $g`
635 if [ "x$val" != x ]; then
636 fail "ref $g unexpectedly exists ($val)"
642 echo refs/tags/$tagpfx/${v//\~/_}
646 git log -n1 --pretty=format:"$1" "$2"
649 t-sametree-parent () {
652 local ctree; ctree=$(t-format-ref '%T' "$ref")
655 for parent in $(t-format-ref '%P' "$ref"); do
656 local ptree; ptree=$(t-format-ref '%T' "$parent")
657 if [ "x$ptree" = "x$ctree" ]; then
661 case "$psame" in ""|" * *") break ;; esac
667 t-check-pushed-master () {
668 local master; master=`t-git-get-ref refs/heads/master`
669 if [ x$master = x$t_ref_val ]; then return; fi
670 if [ x$master = x ]; then fail "failed to push master"; fi
671 # didn't update master, it must be not FF
672 local mbase; mbase=`t-git-merge-base $master $t_ref_val`
673 if [ x$mbase = x$master ]; then fail "failed to ff master"; fi
676 t-push-was-source-only () {
678 t-files-notexist $tmp/incoming/${p}_${v}_*.deb \
679 $tmp/incoming/${p}_${v}_*.udeb
680 # we permit _source.buildinfo files; see test_changes_source_only()
681 for f in $tmp/incoming/${p}_${v}_*.buildinfo; do
684 *_source.buildinfo) ;;
685 *) fail "non-source-only file $f exists!" ;;
693 stat $tmp/incoming/$f
699 local suite=${2:-sid}
705 t-pushed-good-core () {
709 refs/remotes/dgit/dgit/$suite
711 refs/heads/dgit/unstable \
712 refs/remotes/dgit/dgit/unstable
713 (set -e; cd $dgitrepo
717 ${t_check_pushed_master:- : NOT-DRS-NO-CHECK-PUSHED-MASTER}
721 git verify-tag `t-v-tag`
724 t-pushed-good-check-changes () {
725 changes_filename="$tmp/incoming/${p}_${v}_*.changes"
726 grep -E "^Distribution: $suite" $changes_filename
727 grep -E "^Version: $v" $changes_filename
730 t-splitbrain-pushed-good--unpack () {
735 ln -s $tmp/mirror/pool/main/*.orig*.tar* .
736 ln -s $tmp/incoming/*.orig*.tar* . ||:
737 ln -s $incoming_dsc .
738 ln -s ${incoming_dsc/.dsc/.debian.tar}* .
739 ln -s ${incoming_dsc/.dsc/.tar}* . ||:
740 dpkg-source "$@" -x *.dsc
743 git fetch ../../$p "refs/tags/*:refs/tags/*"
746 t-splitbrain-pushed-good--checkprep () {
748 git rm --cached -r --ignore-unmatch .pc
751 t-splitbrain-pushed-good--checkdiff () {
753 t-splitbrain-pushed-good--checkprep
754 t-output "" git diff --stat --cached $tag
757 t-splitbrain-pushed-good-start () {
758 dep14tag=refs/tags/test-dummy/${v//\~/_}
760 t-output "" git status --porcelain
762 t-refs-same $dep14tag
763 (set -e; cd $dgitrepo; t-refs-same $dep14tag)
764 git merge-base --is-ancestor $dep14tag $dgittag
767 t-ref-same refs/heads/split.p
768 case "$(t-git-get-ref refs/heads/split.b)" in
770 "$(git rev-parse refs/heads/split.p^0)") ;;
771 "$(git rev-parse refs/heads/split.p^1)") ;;
778 t-splitbrain-pushed-good--unpack
779 t-splitbrain-pushed-good--checkdiff $dgittag
781 t-splitbrain-pushed-good-end-made-dep14 () {
782 t-splitbrain-pushed-good--checkdiff $dep14tag
786 t-splitbrain-rm-1-patch () {
789 next unless $_ eq "'"$patchname"'\n";
792 rename "debian/patches/$_", "../t-'"$patchname"'" or die $!;
794 ' debian/patches/series
797 t-splitbrain-rm-gitignore-patch () {
798 t-splitbrain-rm-1-patch auto-gitignore
801 t-gbp-pushed-good () {
802 local suite=${1:-sid}
803 t-splitbrain-pushed-good-start
805 # Right, now we want to check that the maintainer tree and
806 # the dgit tree differ in exactly the ways we expect. We
807 # achieve this by trying to reconstruct the maintainer tree
808 # from the dgit tree.
810 # So, unpack it withut the patches applied
811 t-splitbrain-pushed-good--unpack --skip-patches
813 # dgit might have added a .gitignore patch, which we need to
815 t-splitbrain-rm-gitignore-patch
817 # Now the result should differ only in non-debian/ .gitignores
818 t-splitbrain-pushed-good--checkprep
819 git diff --cached --name-only $dep14tag >../changed
821 next if !m#^debian/# && m#(^|/)\.gitignore#;
825 # If we actually apply the gitignore patch by hand, it
827 if [ -f ../t-auto-gitignore ]; then
828 patch --backup-if-mismatch -p1 -u <../t-auto-gitignore
831 t-splitbrain-pushed-good-end-made-dep14
834 t-unapplied-pushed-good () {
835 local suite=${1:-sid}
836 t-splitbrain-pushed-good-start
837 t-splitbrain-pushed-good--unpack --skip-patches
838 t-splitbrain-pushed-good-end-made-dep14
841 t-dpm-pushed-good () {
842 local suite=${1:-sid}
843 t-splitbrain-pushed-good-start
844 t-splitbrain-pushed-good--unpack
845 t-splitbrain-rm-gitignore-patch
846 t-splitbrain-pushed-good-end-made-dep14
849 t-split-unchanged-pushed-good () {
850 local suite=${1:-sid}
851 t-splitbrain-pushed-good-start
852 t-splitbrain-pushed-good--unpack
853 t-splitbrain-pushed-good-end-made-dep14
856 t-commit-build-push-expect-log () {
862 t-dgit push --new 2>&1 |tee $tmp/push.log
863 t-grep-mpat "$mpat" $tmp/push.log
870 use Dpkg::Control::Hash;
871 my $h = new Dpkg::Control::Hash allow_pgp=>1;
872 $h->parse(\*STDIN,"'"$file"'");
873 my $val = $h->{"'$field'"},"\n";
874 die "'"$file $field"'" unless defined $val;
880 export DGIT_TEST_DISTRO=''
882 t-git-config dgit-suite.unstable.distro test-dummy
892 "") '$var'="$tstunt" ;;
893 *) '$var'="$tstunt:$'$var'" ;;
899 t-tstunt--save-real () {
910 p="${p/:"$tmp/tstunt":/:}"
922 *) fail "did not find $f on PATH $PATH" ;;
925 local varname=${f//[^_0-9a-zA-Z]/_}
926 varname=DGIT_TEST_REAL_${varname^^}
929 : \${$varname:=\$real}
935 local tstunt=$tmp/tstunt
936 t-stunt-envvar PATH $tstunt
937 t-stunt-envvar PERLLIB $tstunt
940 t-tstunt--save-real $f
942 local d="$tstunt/${f%/*}"
944 ln -sf "$troot/tstunt/$f" "$d"/.
948 t-tstunt-parsechangelog () {
949 t-tstunt dpkg-parsechangelog Dpkg/Changelog/Parse.pm
952 t-tstunt-lintian () {
956 t-tstunt-debuild () {
961 local dsc=${p}_${v}.dsc
962 incoming_dsc=$tmp/incoming/$dsc
967 local val; val=`t-822-field $incoming_dsc Dgit`
970 die "Dgit $_ ?" unless m/^\w+\b/;
971 print $&,"\n" or die $!;
973 t-ref-same-val $incoming_dsc "$val"
980 debdiff ${p}_${v1}.dsc ${p}_${v2}.dsc || test $? = 1) \
984 t-gbp-unapplied-pq2qc () {
985 # does `gbp pq export'
986 # commits the resulting debian/patches on qc/BRANCH
987 # leaves us on qc/BRANCH (eg "qc/quilt-tip"))
988 # qc/BRANCH is not fast-forwarding
992 branch=`git symbolic-ref HEAD`
993 branch=${branch#refs/heads/}
996 */*) fail "unexpected branch $branch" ;;
999 git branch -f qc/$branch
1000 git checkout qc/$branch
1001 git add debian/patches
1002 git commit -m 'Commit patch queue'
1005 t-git-pseudo-merge () {
1006 # like git merge -s ours
1007 if [ ! "$git_pseuomerge_opts" ]; then
1008 if git merge --help \
1009 | grep -q allow-unrelated-histories; then
1010 git_pseuomerge_opts='--allow-unrelated-histories'
1012 git_pseuomerge_opts+=' -s ours'
1014 git merge $git_pseuomerge_opts "$@"
1017 t-gbp-example-prep-no-ff () {
1018 t-tstunt-parsechangelog
1019 t-archive example 1.0-1
1027 git checkout -b patch-queue/quilt-tip-2 patch-queue/quilt-tip
1030 echo '/* some comment */' >>src.c
1032 git commit -m 'Add a comment to an upstream file'
1034 t-gbp-unapplied-pq2qc
1036 t-commit 'some updates' 1.0-2
1039 t-gbp-example-prep () {
1040 t-gbp-example-prep-no-ff
1042 t-git-pseudo-merge \
1043 -m 'Pseudo-merge to make descendant of archive' \
1044 remotes/dgit/dgit/sid
1047 t-make-badcommit () {
1049 git cat-file commit HEAD | \
1050 perl -pe 's/^committer /commiter /' | \
1051 git hash-object -w -t commit --stdin
1053 t-expect-fsck-fail $badcommit
1057 # leaves ust set to filename of orig tarball
1061 ust=${p}_${v}.orig.tar.gz
1062 GZIP=-1 git archive -o $bpd/$ust --prefix=${p}-${v}/ $tag
1065 t-merge-conflicted-stripping-conflict-markers () {
1066 local otherbranch=$1
1069 t-expect-fail F:"Merge conflict in $file" \
1070 git merge $otherbranch
1072 perl -i~ -ne 'print unless m{^(?:\<\<\<|\>\>\>|===)}' "$file"
1074 git commit --no-edit
1079 v=${2:-${majorv:-1}.$revision}
1080 $troot/tstunt/debchange \
1081 --force-distribution -v$v --distribution ${3:-unstable} "$1"
1082 git add debian/changelog
1084 revision=$(( ${revision-0} + 1 ))
1088 local cmd="$1"; shift
1089 local suite=${1-unstable}
1090 $cmd -r -D "$suite" ''
1094 t-dch-r-rune t-dch-commit "$@"
1098 $troot/tstunt/debchange "$@"
1099 git commit -m "dch $*" debian/changelog
1103 git config --global "$@"
1107 t-git-config dgit-distro.test-dummy.git-url "ext::$troot/drs-git-ext %S "
1108 t-git-config dgit-distro.test-dummy.git-check true
1109 t-git-config dgit-distro.test-dummy.git-create true
1110 cp $troot/gnupg/{dd.gpg,dm.gpg,dm.txt} $tmp/.
1111 cp $troot/suites $tmp/.
1112 cp $troot/suites $tmp/suites-master
1114 export t_check_pushed_master=t-check-pushed-master
1116 drs_dispatch=$tmp/distro=test-dummy
1119 if [ "x$DGIT_TEST_INTREE" != x ]; then
1120 ln -sf "$DGIT_TEST_INTREE" $drs_dispatch/dgit-live
1123 ln -sf $tmp/git $drs_dispatch/repos
1124 ln -sf $tmp/suites $tmp/suites-master $tmp/dm.txt $drs_dispatch/
1125 mkdir -p $drs_dispatch/keyrings
1126 ln -sf $tmp/dd.gpg $drs_dispatch/keyrings/debian-keyring.gpg
1127 ln -sf $tmp/dm.gpg $drs_dispatch/keyrings/debian-maintainers.gpg
1128 ln -sf /bin/true $drs_dispatch/policy-hook
1133 t-git-config dgit-distro.test-dummy.ssh "$troot/dsd-ssh"
1134 t-git-config dgit-distro.test-dummy.git-check ssh-cmd
1135 t-git-config dgit-distro.test-dummy.git-create true
1136 t-git-config dgit-distro.test-dummy.git-url \
1137 "ext::$troot/dsd-ssh X %S /dgit/test-dummy/repos"
1139 t-git-config dgit-distro.test-dummy.diverts.drs /drs
1140 t-git-config dgit-distro.test-dummy/drs.ssh "$troot/ssh"
1141 t-git-config dgit-distro.test-dummy/drs.git-url $tmp/git
1142 t-git-config dgit-distro.test-dummy/drs.git-check ssh-cmd
1143 t-git-config dgit-distro.test-dummy/drs.git-create ssh-cmd
1145 echo 'no-such-package* drs' >$drs_dispatch/diverts
1149 : '(((((((((((((((((((((((((((((((((((((((('
1150 ${DGIT_INFRA_PFX}dgit-repos-admin-debian --repos $tmp/git "$@"
1151 : '))))))))))))))))))))))))))))))))))))))))'
1154 t-policy-nonexist () {
1155 ln -sf no-such-file-or-directory $drs_dispatch/policy-hook
1158 t-make-hook-link () {
1159 local hook=$1 # in infra/
1161 hook=${DGIT_INFRA_PFX}$hook
1164 *) hook=`type -P $hook` ;;
1166 ln -sf "$hook" $linkpath
1171 t-make-hook-link $policyhook $drs_dispatch/policy-hook
1176 t-policy dgit-repos-policy-debian
1179 t-policy-admin create-db
1182 t-policy-periodic () {
1183 : '(((((((((((((((((((((((((((((((((((((((('
1184 ${DGIT_REPOS_SERVER_TEST-dgit-repos-server} \
1185 test-dummy $drs_dispatch '' --cron
1186 : '))))))))))))))))))))))))))))))))))))))))'
1189 t-buildproductsdir-config () {
1191 t-git-config dgit.default.build-products-dir $bpd
1193 cat <<END >>$tmp/.gbp.conf
1200 local restriction=$1
1201 (cd $root; t-restriction-$restriction >&2)
1205 : "Hopefully installed: $*"
1212 export DGIT_TEST_TESTNAME="$testname"
1213 export DGIT_TEST_TMPBASE="$tmpbase"
1221 t-chain-test "${t#*-}"
1224 t-git-config dgit.default.old-dsc-distro test-dummy
1226 for import in ${autoimport-gnupg}; do
1230 t-setup-import $import