17 lines: ${BASH_LINENO[*]}
18 files: ${BASH_SOURCE[*]}
28 [ "x$DGIT_TEST_KEEP_MUSTCLEAN" != x ] || \
29 [ "x$DGIT_TEST_TMP" = x ] || rm -rf $DGIT_TEST_TMP/must-clean
31 test $rc = 0 || t-report-failure
34 t-filter-out-git-hyphen-dir
38 : ${DGIT_TEST_DEBUG=-D}
39 export DGIT_TEST_DEBUG
41 : ${DGIT_TEST_DEBPUSH_DEBUG=x}
42 export DGIT_TEST_DEBPUSH_DEBUG
44 : ${DGIT_TEST_DISTRO+ ${distro=${DGIT_TEST_DISTRO}}}
46 export GIT_COMMITTER_DATE='1530000000 +0100'
47 export GIT_AUTHOR_DATE='1530000000 +0100'
49 export LC_CTYPE=C.UTF-8
54 testname="${DGIT_TEST_TESTNAME-${0##*/}}"
55 export DGIT_TEST_TROOT=$troot
59 if [ x"$tmp" = x ]; then
60 export DGIT_TEST_BYHAND=1
63 tmp=tests/tmp/$testname
66 elif [ "x$DGIT_TEST_TMPBASE" != x ]; then
67 tmpbase="$DGIT_TEST_TMPBASE"
75 test -f $tmp/.save-env || \
76 env -0 >$tmp/.save-env
80 export DEBCHANGE_VENDOR=dpkg
84 mkdir -p $tmp/must-clean
85 # must-clean is usually removed after each test, on success or failure.
86 # But this must not be relied on for correctness, only for garbage
89 mkdir -p $tmp/incoming
90 cat <<END >$tmp/dput.cf
93 incoming = $tmp/incoming
97 schroot=${DGIT_SCHROOT_CHROOT:-build}
98 # Pretty much any Debian sid snapshot schroot will do.
100 : ${t_archive_method:=aq}
101 : ${tagpfx:=archive/test-dummy}
102 : ${suitespecs:=sid:unstable}
105 GIT_COMMITTER_DATE="$(( ${GIT_COMMITTER_DATE%% *} + 1 )) ${GIT_COMMITTER_DATE#* }"
106 GIT_AUTHOR_DATE="$GIT_COMMITTER_DATE"
110 local mpat="$1"; shift
113 LC_MESSAGES=${expect_fail_lcmessages-C} \
114 LANGUAGE=${expect_fail_lcmessages-C} \
115 "$@" 2>&1 | tee $tmp/t.output
116 local ps="${PIPESTATUS[*]}"
120 "0 0") fail "command unexpectedly succeeded (instead of: $mpat)" ;;
122 *) fail "tee failed" ;;
125 t-grep-mpat "$mpat" $tmp/t.output
136 E:*) grepper=egrep ;;
137 F:*) grepper=fgrep ;;
138 *) fail "bad mpat prefix in $mpat";;
144 $grepper -e "$mpat" "$file" ||
145 fail "message not found"
148 t-expect-push-fail () {
149 local mpat="$1"; shift
151 local triedpush; triedpush=`git rev-parse HEAD`
154 t-expect-fail "$mpat" "$@"
156 diff $tmp/show-refs.{pre,post}-push
158 t-git-objects-not-present '' $triedpush
160 eval "$t_expect_push_fail_hook"
163 t-git-objects-not-present () {
164 # t-git-objects-not-present GITDIR|'' OBJID [...]
165 # specifying '' means the repo for package $p
166 local gitdir="${1-$dgitrepo}"
168 if ! [ -e "$gitdir" ]; then return; fi
171 t-expect-fail 'unable to find' \
177 local whichoutput=$1; shift
178 local whichrepo=${1-$dgitrepo}
179 local outputfile="$tmp/show-refs.$whichoutput"
182 if test -d $whichrepo; then
190 local edittree=$1.edit
191 if test -d "$edittree"; then
192 cp -a "$edittree"/* .
200 t-untar $troot/worktrees/${p}_$1
203 t-select-package () {
205 dgitrepo=$tmp/git/$p.git
212 local gs=$troot/git-srcs/${p}_$v.git
213 (set -e; cd $tmp/git; t-untar $gs)
218 (set -e; cd $tmp/git; tar xf $troot/git-template.tar)
221 t-salsa-add-remote () {
222 local d=$tmp/salsa/$p
224 (set -e; cd $d; git init --bare)
225 git remote add ${1-origin} $d
228 t-git-merge-base () {
229 git merge-base $1 $2 || test $? = 1
233 # t-has-ancestor ANCESTOR
234 # (CHILD is implicit, HEAD)
235 local now; now=`git rev-parse HEAD`
236 local ancestor; ancestor=`git rev-parse $1^{}`
237 local mbase; mbase=`t-git-merge-base $ancestor $now`
238 if [ x$mbase != x$ancestor ]; then
239 fail "not ff $ancestor..$now, $mbase != $ancestor"
243 t-has-parent-or-is () {
244 # t-has-parent-or-is CHILD PARENT
248 parents=$(git show --pretty=format:' %P %H ' "$child")
249 parent=$(git rev-parse "$parent~0")
252 *) fail "child $child lacks parent $parent" ;;
256 t-prep-newpackage () {
263 if ! git show-ref --verify --quiet refs/heads/master; then
264 git branch -m dgit/sid master
272 t-archive-none-$t_archive_method
274 t-archive-none-aq () {
275 mkdir -p $tmp/aq/dsc_in_suite $tmp/mirror/pool/main
281 for suitespec in $suitespecs; do
282 local suite=${suitespec%%:*}
283 local sname=${suitespec#*:}
285 >$tmp/aq/package.$suite.$p
286 t-aq-archive-updated $suite $p
288 >$tmp/aq/package.new.$p
289 t-aq-archive-updated new $p
291 ln -sf $suite $tmp/aq/dsc_in_suite/$sname
293 cat <<END >>$tmp/aq/suites
296 "archive" : "ftp-master",
297 "codename" : "$suite",
310 cat <<END >>$tmp/aq/suites
316 t-aq-archive-updated () {
319 local suitedir=$tmp/aq/dsc_in_suite/$suite
321 perl <$tmp/aq/package.$suite.$p >$suitedir/$p -wne '
325 m{^(\S+) (\w+) ([^ \t/]+)/(\S+)} or die;
333 my $json = JSON->new->canonical();
334 print $json->encode(\@v) or die $!;
339 t-archive-process-incoming () {
341 mv $tmp/incoming/${p}_* $tmp/mirror/pool/main/
342 t-archive-query "$suite"
347 local dscf=main/${p}_${v}.dsc
348 t-archive-query-$t_archive_method "$suite" "$p" "$v" "$dscf"
350 t-archive-query-aq () {
355 local sha; sha=`sha256sum <$tmp/mirror/pool/$dscf`
356 echo "${v} ${sha% -} $dscf" >>$tmp/aq/package.$suite.${p}
357 t-aq-archive-updated $suite $p
363 local dscf=${p}_$2.dsc
364 rm -f $tmp/mirror/pool/main/${p}_*
365 ln -s $troot/pkg-srcs/${p}_${2%-*}* $tmp/mirror/pool/main/
366 t-archive-query $suite
369 (set -e; cd $tmp/extract; dpkg-source -x ../mirror/pool/main/$dscf)
372 t-git-dir-time-passes () {
373 touch -d 'last year' $dgitrepo
377 local gitdir=$dgitrepo
380 if test -e "$gitdir"; then fail "$gitdir exists"; fi
383 public) wantstat='7[75]5' ;;
384 secret) wantstat='7[70]0' ;;
385 *) fail "$1 t-git-dir-check ?" ;;
387 gotstat=`stat -c%a $gitdir`
389 *$wantstat) return ;;
390 *) fail "$gitdir has mode $gotstat, expected $wantstat" ;;
394 t-expect-fsck-fail () {
395 echo >>$tmp/fsck.expected-errors "$1"
399 local fsckerrs=$(git rev-parse --git-dir)/dgit-test-fsck.errs
402 LC_MESSAGES=C git fsck --no-dangling --strict 2>&1 \
404 ps="${PIPESTATUS[*]}"
408 if [ -f $tmp/fsck.expected-errors ]; then
409 pats=(-w -f $tmp/fsck.expected-errors)
413 pats+=(-e 'notice: HEAD points to an unborn branch')
414 pats+=(-e 'notice: No default references')
417 grep -v "${pats[@]}" $fsckerrs
421 1) ;; # no unexpected errors
422 0) fail "unexpected messages from git-fsck" ;;
423 *) fail "grep of git-fsck failed" ;;
427 t-check-only-bpd () {
428 if [ "$bpd" = .. ]; then return; fi
430 $tmp/*.{deb,changes,dsc,buildinfo} \
437 for d in $tmp/*/.git $tmp/git/*.git; do
445 : '========================================'
452 t-save-artifacts () {
453 artifacts="$AUTOPKGTEST_ARTIFACTS"
454 if [ x"$artifacts" = x ]; then return; fi
455 if [ x"tmp" = x ]; then return; fi
456 GZIP=-1v tar -C "$tmp" -zc -f "$artifacts/${0##*/}.tar.gz" \
460 t-rm-dput-dropping () {
461 rm -f $tmp/${p}_${v}_*.upload
465 local dgit=${DGIT_TEST-dgit}
468 {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{'
469 $dgit --dgit=$dgit --dget:-u --dput:--config=$tmp/dput.cf \
470 ${dgit_config_debian_alias-"--config-lookup-explode=dgit-distro.debian.alias-canon"} \
471 ${DGIT_GITDEBREBASE_TEST+--git-debrebase=}${DGIT_GITDEBREBASE_TEST} \
472 ${distro+${distro:+-d}}${distro--dtest-dummy} \
473 $DGIT_TEST_OPTS $DGIT_TEST_DEBUG \
474 -kBCD22CD83243B79D3DFAC33EA3DBCBC039B13D8A $t_dgit_xopts "$@"
475 : '}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
479 t-non-dgit-upload () {
480 t-dgit -wgf build-source
483 c=${p}_${v}_source.changes
484 debsign -kBCD22CD83243B79D3DFAC33EA3DBCBC039B13D8A $c
485 dput -c $tmp/dput.cf test-dummy $c
487 t-archive-process-incoming sid
495 (export LC_ALL=C.UTF-8
496 if [ "$DGIT_TEST_INTREE" ]; then
497 make -C $DGIT_TEST_INTREE $page.$section.view
504 diff --exclude=.git --exclude=.pc -ruN $*
507 t-files-notexist () {
516 t-cloned-fetched-good () {
517 t-diff-nogit ../extract/$p-${v%-*} .
518 t-clean-on-branch dgit/sid
521 refs/heads/dgit/sid \
522 refs/remotes/dgit/dgit/sid
523 t-refs-notexist refs/dgit/unstable refs/remotes/dgit/dgit/unstable
527 printf "%s${1:+\n}" "$1" >$tmp/t.want
530 diff $tmp/t.want $tmp/t.got
533 t-clean-on-branch () {
534 t-output "## $1" git status -b --porcelain
542 local import=IMPORT.${DGIT_TEST_TESTNAME-${0##*/}}
543 exec 4>$tmp/$import.new
546 for vn in $savevars; do
547 perl >&4 -"I$root" -MDebian::Dgit -e '
548 printf "%s=%s\n", $ARGV[0], shellquote $ARGV[1]
549 ' $vn "$(eval "printf '%s\n' \"\$$vn\"")"
552 perl >&4 -"I$root" -MDebian::Dgit -we '
553 foreach my $vn (grep m/^DGIT_TEST_REAL_/, keys %ENV) {
554 print STDERR "saving-exporting $vn\n";
555 printf "export %s=%s\n", $vn, shellquote $ENV{$vn}
560 (set -e; cd $tmp; tar cf $import.tar $savedirs)
562 printf >&4 "\n%s\n" "$importeval"
564 mv -f $tmp/$import.new $tmp/$import
572 if [ "x$tmpbase" = x ]; then
573 # ADTTMP was set on entry to tests/lib, so we
574 # are not sharing tmp area between tests
576 lock="$tmp/.dummy.lock"
578 setupsrc="$tmpbase/$setupname"
579 lock="$setupsrc.lock"
582 local simport="$setupsrc/IMPORT.$setupname"
584 if ! [ -e "$simport" ]; then
585 with-lock-ex -w "$lock" \
586 xargs -0 -a $tmp/.save-env \
589 setupname="$1"; shift
591 if [ -e "$simport" ]; then exit 0; fi
593 "tests/setup/$setupname"
594 ' x "$root" "$setupname" "$simport"
597 if [ "x$setupsrc" != "x$tmp" ]; then
598 (set -e; cd $tmp; tar xf "$simport.tar")
601 mkdir -p $tmp/must-clean
606 t-git-get-ref-exact () {
608 # does not dereference, unlike t-git-get-ref
611 *) fail "t-git-get-ref-exact bad $ref" ;;
613 git for-each-ref --format='%(objectname)' "[r]efs/${ref#refs/}"
620 *) fail "t-git-get-ref bad $ref" ;;
622 (git show-ref -d $1 || test $? = 1) | perl -ne '
623 $x = $1 if m#^(\w+) \Q'$1'\E(?:\^\{\})?$#;
624 END { print "$x\n" if length $x; }
628 t-ref-same-exact () {
630 local val; val=`t-git-get-ref-exact $name`
631 t-ref-same-val "$name" $val
636 local val; val=`t-git-get-ref $name`
637 t-ref-same-val "$name" $val
641 local val; val=`git rev-parse HEAD`
642 t-ref-same-val HEAD $val
648 case "${t_ref_val-unset}" in
651 *) fail "ref varies: ($name)\
652 ${val:-nothing} != ${t_ref_val:-nothing} (${t_ref_names[*]})" ;;
655 t_ref_names+=("$name")
658 t-refs-same-start () {
673 val=`t-git-get-ref $g`
674 if [ "x$val" != x ]; then
675 fail "ref $g unexpectedly exists ($val)"
681 echo refs/tags/$tagpfx/${v//\~/_}
685 git log -n1 --pretty=format:"$1" "$2"
688 t-sametree-parent () {
691 local ctree; ctree=$(t-format-ref '%T' "$ref")
694 for parent in $(t-format-ref '%P' "$ref"); do
695 local ptree; ptree=$(t-format-ref '%T' "$parent")
696 if [ "x$ptree" = "x$ctree" ]; then
700 case "$psame" in ""|" * *") break ;; esac
706 t-check-pushed-master () {
707 local master; master=`t-git-get-ref refs/heads/master`
708 if [ x$master = x$t_ref_val ]; then return; fi
709 if [ x$master = x ]; then fail "failed to push master"; fi
710 # didn't update master, it must be not FF
711 local mbase; mbase=`t-git-merge-base $master $t_ref_val`
712 if [ x$mbase = x$master ]; then fail "failed to ff master"; fi
715 t-push-was-source-only () {
717 t-files-notexist $tmp/incoming/${p}_${v}_*.deb \
718 $tmp/incoming/${p}_${v}_*.udeb
719 # we permit _source.buildinfo files; see test_changes_source_only()
720 for f in $tmp/incoming/${p}_${v}_*.buildinfo; do
723 *_source.buildinfo) ;;
724 *) fail "non-source-only file $f exists!" ;;
732 stat $tmp/incoming/$f
738 local suite=${2:-sid}
744 t-pushed-good-core () {
748 refs/remotes/dgit/dgit/$suite
750 refs/heads/dgit/unstable \
751 refs/remotes/dgit/dgit/unstable
752 (set -e; cd $dgitrepo
756 ${t_check_pushed_master:- : NOT-DRS-NO-CHECK-PUSHED-MASTER}
760 git verify-tag `t-v-tag`
763 t-pushed-good-check-changes () {
764 changes_filename="$tmp/incoming/${p}_${v}_*.changes"
765 grep -E "^Distribution: $suite" $changes_filename
766 grep -E "^Version: $v" $changes_filename
769 t-splitbrain-pushed-good--unpack () {
774 ln -s $tmp/mirror/pool/main/*.orig*.tar* .
775 ln -s $tmp/incoming/*.orig*.tar* . ||:
776 ln -s $incoming_dsc .
777 ln -s ${incoming_dsc/.dsc/.debian.tar}* .
778 ln -s ${incoming_dsc/.dsc/.tar}* . ||:
779 dpkg-source "$@" -x *.dsc
782 git fetch ../../$p "refs/tags/*:refs/tags/*"
785 t-splitbrain-pushed-good--checkprep () {
787 git rm --cached -r --ignore-unmatch .pc
790 t-splitbrain-pushed-good--checkdiff () {
792 t-splitbrain-pushed-good--checkprep
793 t-output "" git diff --stat --cached $tag
796 t-splitbrain-pushed-good-start () {
797 dep14tag=refs/tags/test-dummy/${v//\~/_}
799 t-output "" git status --porcelain
801 t-refs-same $dep14tag
802 (set -e; cd $dgitrepo; t-refs-same $dep14tag)
803 git merge-base --is-ancestor $dep14tag $dgittag
806 t-ref-same refs/heads/split.p
807 local split_b=$(t-git-get-ref refs/heads/split.b)
810 "$(git rev-parse refs/heads/split.p^0)") ;;
811 "$(git rev-parse refs/heads/split.p^1)") ;;
812 *) fail "bad b/p (b=$split_b)" ;;
818 t-splitbrain-pushed-good--unpack
819 t-splitbrain-pushed-good--checkdiff $dgittag
821 t-splitbrain-pushed-good-end-made-dep14 () {
822 t-splitbrain-pushed-good--checkdiff $dep14tag
826 t-splitbrain-rm-1-patch () {
829 next unless $_ eq "'"$patchname"'\n";
832 rename "debian/patches/$_", "../t-'"$patchname"'" or die $!;
834 ' debian/patches/series
837 t-splitbrain-rm-gitignore-patch () {
838 t-splitbrain-rm-1-patch auto-gitignore
841 t-gbp-pushed-good () {
842 local suite=${1:-sid}
843 t-splitbrain-pushed-good-start
845 # Right, now we want to check that the maintainer tree and
846 # the dgit tree differ in exactly the ways we expect. We
847 # achieve this by trying to reconstruct the maintainer tree
848 # from the dgit tree.
850 # So, unpack it withut the patches applied
851 t-splitbrain-pushed-good--unpack --skip-patches
853 # dgit might have added a .gitignore patch, which we need to
855 t-splitbrain-rm-gitignore-patch
857 # Now the result should differ only in non-debian/ .gitignores
858 t-splitbrain-pushed-good--checkprep
859 git diff --cached --name-only $dep14tag >../changed
861 next if !m#^debian/# && m#(^|/)\.gitignore#;
865 # If we actually apply the gitignore patch by hand, it
867 if [ -f ../t-auto-gitignore ]; then
868 patch --backup-if-mismatch -p1 -u <../t-auto-gitignore
871 t-splitbrain-pushed-good-end-made-dep14
874 t-unapplied-pushed-good () {
875 local suite=${1:-sid}
876 t-splitbrain-pushed-good-start
877 t-splitbrain-pushed-good--unpack --skip-patches
878 t-splitbrain-pushed-good-end-made-dep14
881 t-dpm-pushed-good () {
882 local suite=${1:-sid}
883 t-splitbrain-pushed-good-start
884 t-splitbrain-pushed-good--unpack
885 t-splitbrain-rm-gitignore-patch
886 t-splitbrain-pushed-good-end-made-dep14
889 t-split-unchanged-pushed-good () {
890 local suite=${1:-sid}
891 t-splitbrain-pushed-good-start
892 t-splitbrain-pushed-good--unpack
893 t-splitbrain-pushed-good-end-made-dep14
896 t-commit-build-push-expect-log () {
902 t-dgit push --new 2>&1 |tee $tmp/push.log
903 t-grep-mpat "$mpat" $tmp/push.log
910 use Dpkg::Control::Hash;
911 my $h = new Dpkg::Control::Hash allow_pgp=>1;
912 $h->parse(\*STDIN,"'"$file"'");
913 my $val = $h->{"'$field'"},"\n";
914 die "'"$file $field"'" unless defined $val;
920 export DGIT_TEST_DISTRO=''
922 t-git-config dgit-suite.unstable.distro test-dummy
932 "") '$var'="$tstunt" ;;
933 *) '$var'="$tstunt:$'$var'" ;;
939 t-tstunt--save-real () {
950 p="${p/:"$tmp/tstunt":/:}"
962 *) fail "did not find $f on PATH $PATH" ;;
965 local varname=${f//[^_0-9a-zA-Z]/_}
966 varname=DGIT_TEST_REAL_${varname^^}
969 : \${$varname:=\$real}
975 local tstunt=$tmp/tstunt
976 t-stunt-envvar PATH $tstunt
977 t-stunt-envvar PERLLIB $tstunt
980 t-tstunt--save-real $f
982 local d="$tstunt/${f%/*}"
984 ln -sf "$troot/tstunt/$f" "$d"/.
988 t-tstunt-parsechangelog () {
989 t-tstunt dpkg-parsechangelog Dpkg/Changelog/Parse.pm
992 t-tstunt-lintian () {
996 t-tstunt-debuild () {
1001 local dsc=${p}_${v}.dsc
1002 incoming_dsc=$tmp/incoming/$dsc
1007 local val; val=`t-822-field $incoming_dsc Dgit`
1010 die "Dgit $_ ?" unless m/^\w+\b/;
1011 print $&,"\n" or die $!;
1013 t-ref-same-val $incoming_dsc "$val"
1019 (cd $troot/pkg-srcs;
1020 debdiff ${p}_${v1}.dsc ${p}_${v2}.dsc || test $? = 1) \
1024 t-gbp-unapplied-pq2qc () {
1025 # does `gbp pq export'
1026 # commits the resulting debian/patches on qc/BRANCH
1027 # leaves us on qc/BRANCH (eg "qc/quilt-tip"))
1028 # qc/BRANCH is not fast-forwarding
1032 branch=`git symbolic-ref HEAD`
1033 branch=${branch#refs/heads/}
1036 */*) fail "unexpected branch $branch" ;;
1039 git branch -f qc/$branch
1040 git checkout qc/$branch
1041 git add debian/patches
1042 git commit -m 'Commit patch queue'
1045 t-git-pseudo-merge () {
1046 # like git merge -s ours
1047 if [ ! "$git_pseuomerge_opts" ]; then
1048 if git merge --help \
1049 | grep -q allow-unrelated-histories; then
1050 git_pseuomerge_opts='--allow-unrelated-histories'
1052 git_pseuomerge_opts+=' -s ours'
1054 git merge $git_pseuomerge_opts "$@"
1057 t-gbp-example-prep-no-ff () {
1058 t-archive example 1.0-1
1066 git checkout -b patch-queue/quilt-tip-2 patch-queue/quilt-tip
1069 echo '/* some comment */' >>src.c
1071 git commit -m 'Add a comment to an upstream file'
1073 t-gbp-unapplied-pq2qc
1075 t-commit 'some updates' 1.0-2
1078 t-gbp-example-prep () {
1079 t-gbp-example-prep-no-ff
1081 t-git-pseudo-merge \
1082 -m 'Pseudo-merge to make descendant of archive' \
1083 remotes/dgit/dgit/sid
1086 t-make-badcommit () {
1088 git cat-file commit HEAD | \
1089 perl -pe 's/^committer /commiter /' | \
1090 git hash-object -w -t commit --stdin
1092 t-expect-fsck-fail $badcommit
1096 # leaves ust set to filename of orig tarball
1100 ust=${p}_${v}.orig.tar.gz
1101 GZIP=-1 git archive -o $bpd/$ust --prefix=${p}-${v}/ $tag
1104 t-merge-conflicted-stripping-conflict-markers () {
1105 local otherbranch=$1
1108 t-expect-fail F:"Merge conflict in $file" \
1109 git merge $otherbranch
1111 perl -i~ -ne 'print unless m{^(?:\<\<\<|\>\>\>|===)}' "$file"
1113 git commit --no-edit
1118 v=${2:-${majorv:-1}.$revision}
1119 $troot/tstunt/debchange \
1120 --force-distribution -v$v --distribution ${3:-unstable} "$1"
1121 git add debian/changelog
1123 revision=$(( ${revision-0} + 1 ))
1127 local cmd="$1"; shift
1128 local suite=${1-unstable}
1129 $cmd -r -D "$suite" ''
1133 t-dch-r-rune t-dch-commit "$@"
1137 $troot/tstunt/debchange "$@"
1138 git commit -m "dch $*" debian/changelog
1142 git config --global "$@"
1146 t-git-config dgit-distro.test-dummy.git-url "ext::$troot/drs-git-ext %S "
1147 t-git-config dgit-distro.test-dummy.git-check true
1148 t-git-config dgit-distro.test-dummy.git-create true
1149 cp $troot/gnupg/{dd.gpg,dm.gpg,dm.txt} $tmp/.
1150 cp $troot/suites $tmp/.
1151 cp $troot/suites $tmp/suites-master
1153 export t_check_pushed_master=t-check-pushed-master
1155 drs_dispatch=$tmp/distro=test-dummy
1158 if [ "x$DGIT_TEST_INTREE" != x ]; then
1159 ln -sf "$DGIT_TEST_INTREE" $drs_dispatch/dgit-live
1162 ln -sf $tmp/git $drs_dispatch/repos
1163 ln -sf $tmp/suites $tmp/suites-master $tmp/dm.txt $drs_dispatch/
1164 mkdir -p $drs_dispatch/keyrings
1165 ln -sf $tmp/dd.gpg $drs_dispatch/keyrings/debian-keyring.gpg
1166 ln -sf $tmp/dm.gpg $drs_dispatch/keyrings/debian-maintainers.gpg
1167 ln -sf /bin/true $drs_dispatch/policy-hook
1172 t-git-config dgit-distro.test-dummy.ssh "$troot/dsd-ssh"
1173 t-git-config dgit-distro.test-dummy.git-check ssh-cmd
1174 t-git-config dgit-distro.test-dummy.git-create true
1175 t-git-config dgit-distro.test-dummy.git-url \
1176 "ext::$troot/dsd-ssh X %S /dgit/test-dummy/repos"
1178 t-git-config dgit-distro.test-dummy.diverts.drs /drs
1179 t-git-config dgit-distro.test-dummy/drs.ssh "$troot/ssh"
1180 t-git-config dgit-distro.test-dummy/drs.git-url $tmp/git
1181 t-git-config dgit-distro.test-dummy/drs.git-check ssh-cmd
1182 t-git-config dgit-distro.test-dummy/drs.git-create ssh-cmd
1184 echo 'no-such-package* drs' >$drs_dispatch/diverts
1188 : '(((((((((((((((((((((((((((((((((((((((('
1189 ${DGIT_INFRA_PFX}dgit-repos-admin-debian --repos $tmp/git "$@"
1190 : '))))))))))))))))))))))))))))))))))))))))'
1193 t-policy-nonexist () {
1194 ln -sf no-such-file-or-directory $drs_dispatch/policy-hook
1197 t-make-hook-link () {
1198 local hook=$1 # in infra/
1200 hook=${DGIT_INFRA_PFX}$hook
1203 *) hook=`type -P $hook` ;;
1205 ln -sf "$hook" $linkpath
1210 t-make-hook-link $policyhook $drs_dispatch/policy-hook
1215 t-policy dgit-repos-policy-debian
1218 t-policy-admin create-db
1221 t-policy-periodic () {
1222 : '(((((((((((((((((((((((((((((((((((((((('
1223 ${DGIT_REPOS_SERVER_TEST-dgit-repos-server} \
1224 test-dummy $drs_dispatch '' --cron
1225 : '))))))))))))))))))))))))))))))))))))))))'
1228 t-tagupl-settings () {
1229 export DGIT_DRS_EMAIL_NOREPLY=noreply@example.org
1230 export DGIT_DRS_SENDMAIL=$troot/tstunt/sendmail
1231 export DGIT_DRS_DGIT=$troot/tstunt/dgit
1232 t-chain-test-somehow
1234 mkdir ../pretend-salsa
1235 (set -e; cd ../pretend-salsa; git init --bare)
1236 git remote add salsa $tmp/pretend-salsa
1237 # git branch --set-upstream-to complains, so
1238 git config branch.master.remote salsa
1239 git config branch.master.merge refs/heads/master
1242 t-tagupl-run-drs () {
1247 DGIT_DRS_ANY_URL=1 \
1248 DGIT_DRS_MODE="tag2upload $source $tagname" \
1255 ${DGIT_DEBPUSH_TEST-git debpush} \
1256 --distro=test-dummy -u Senatus "$@"
1259 t-tagupl-run-drs $tmp/pretend-salsa
1262 t-refs-same refs/heads/master
1268 t-buildproductsdir-config () {
1270 t-git-config dgit.default.build-products-dir $bpd
1272 cat <<END >>$tmp/.gbp.conf
1279 local restriction=$1
1280 (cd $root; t-restriction-$restriction >&2)
1284 : "Hopefully installed: $*"
1287 t-chain-test-somehow () {
1288 export DGIT_TEST_TESTNAME="$testname"
1289 export DGIT_TEST_TMPBASE="$tmpbase"
1294 t-chain-test-somehow
1304 t-chain-test "${t#*-}"
1307 t-git-config dgit.default.old-dsc-distro test-dummy
1309 for import in ${autoimport-gnupg}; do
1313 t-setup-import $import