17 lines: ${BASH_LINENO[*]}
18 files: ${BASH_SOURCE[*]}
28 test $rc = 0 || echo "
29 %%%%%%%%%%%%%%%%%%%% EXITING $rc %%%%%%%%%%%%%%%%%%%%
31 Most relevant logs are just before assignment rc=$rc
32 Will now do cleanup etc.
37 [ "x$DGIT_TEST_KEEP_MUSTCLEAN" != x ] || \
38 [ "x$DGIT_TEST_TMP" = x ] || rm -rf $DGIT_TEST_TMP/must-clean
40 test $rc = 0 || t-report-failure
43 t-filter-out-git-hyphen-dir
47 : ${DGIT_TEST_DEBUG=-D}
48 export DGIT_TEST_DEBUG
50 : ${DGIT_TEST_DEBPUSH_DEBUG=x}
51 export DGIT_TEST_DEBPUSH_DEBUG
53 : ${DGIT_TEST_DISTRO+ ${distro=${DGIT_TEST_DISTRO}}}
55 export GIT_COMMITTER_DATE='1530000000 +0100'
56 export GIT_AUTHOR_DATE='1530000000 +0100'
58 export LC_CTYPE=C.UTF-8
63 testname="${DGIT_TEST_TESTNAME-${0##*/}}"
64 export DGIT_TEST_TROOT=$troot
68 if [ x"$tmp" = x ]; then
69 export DGIT_TEST_BYHAND=1
72 tmp=tests/tmp/$testname
75 elif [ "x$DGIT_TEST_TMPBASE" != x ]; then
76 tmpbase="$DGIT_TEST_TMPBASE"
84 test -f $tmp/.save-env || \
85 env -0 >$tmp/.save-env
89 export DEBCHANGE_VENDOR=dpkg
93 mkdir -p $tmp/must-clean
94 # must-clean is usually removed after each test, on success or failure.
95 # But this must not be relied on for correctness, only for garbage
98 mkdir -p $tmp/incoming
99 cat <<END >$tmp/dput.cf
102 incoming = $tmp/incoming
106 schroot=${DGIT_SCHROOT_CHROOT:-build}
107 # Pretty much any Debian sid snapshot schroot will do.
109 : ${t_archive_method:=aq}
110 : ${tagpfx:=archive/test-dummy}
111 : ${suitespecs:=sid:unstable}
114 GIT_COMMITTER_DATE="$(( ${GIT_COMMITTER_DATE%% *} + 1 )) ${GIT_COMMITTER_DATE#* }"
115 GIT_AUTHOR_DATE="$GIT_COMMITTER_DATE"
119 local mpat="$1"; shift
122 LC_MESSAGES=${expect_fail_lcmessages-C} \
123 LANGUAGE=${expect_fail_lcmessages-C} \
124 "$@" 2>&1 | tee $tmp/t.output
125 local ps="${PIPESTATUS[*]}"
129 "0 0") fail "command unexpectedly succeeded (instead of: $mpat)" ;;
131 *) fail "tee failed" ;;
134 t-grep-mpat "$mpat" $tmp/t.output
145 E:*) grepper=egrep ;;
146 F:*) grepper=fgrep ;;
147 *) fail "bad mpat prefix in $mpat";;
153 $grepper -e "$mpat" "$file" ||
154 fail "message not found"
157 t-expect-push-fail () {
158 local mpat="$1"; shift
160 local triedpush; triedpush=`git rev-parse HEAD`
163 t-expect-fail "$mpat" "$@"
165 diff $tmp/show-refs.{pre,post}-push
167 t-git-objects-not-present '' $triedpush
169 eval "$t_expect_push_fail_hook"
172 t-git-objects-not-present () {
173 # t-git-objects-not-present GITDIR|'' OBJID [...]
174 # specifying '' means the repo for package $p
175 local gitdir="${1-$dgitrepo}"
177 if ! [ -e "$gitdir" ]; then return; fi
180 t-expect-fail 'unable to find' \
186 local whichoutput=$1; shift
187 local whichrepo=${1-$dgitrepo}
188 local outputfile="$tmp/show-refs.$whichoutput"
191 if test -d $whichrepo; then
199 local edittree=$1.edit
200 if test -d "$edittree"; then
201 cp -a "$edittree"/* .
209 t-untar $troot/worktrees/${p}_$1
212 t-select-package () {
214 dgitrepo=$tmp/git/$p.git
221 local gs=$troot/git-srcs/${p}_$v.git
222 (set -e; cd $tmp/git; t-untar $gs)
227 (set -e; cd $tmp/git; tar xf $troot/git-template.tar)
230 t-salsa-add-remote () {
231 local d=$tmp/salsa/$p
233 (set -e; cd $d; git init --bare)
234 git remote add ${1-origin} $d
237 t-git-merge-base () {
238 git merge-base $1 $2 || test $? = 1
242 # t-has-ancestor ANCESTOR
243 # (CHILD is implicit, HEAD)
244 local now; now=`git rev-parse HEAD`
245 local ancestor; ancestor=`git rev-parse $1^{}`
246 local mbase; mbase=`t-git-merge-base $ancestor $now`
247 if [ x$mbase != x$ancestor ]; then
248 fail "not ff $ancestor..$now, $mbase != $ancestor"
252 t-has-parent-or-is () {
253 # t-has-parent-or-is CHILD PARENT
257 parents=$(git show --pretty=format:' %P %H ' "$child")
258 parent=$(git rev-parse "$parent~0")
261 *) fail "child $child lacks parent $parent" ;;
265 t-prep-newpackage () {
272 if ! git show-ref --verify --quiet refs/heads/master; then
273 git branch -m dgit/sid master
281 t-archive-none-$t_archive_method
283 t-archive-none-aq () {
284 mkdir -p $tmp/aq/dsc_in_suite $tmp/mirror/pool/main
290 for suitespec in $suitespecs; do
291 local suite=${suitespec%%:*}
292 local sname=${suitespec#*:}
294 >$tmp/aq/package.$suite.$p
295 t-aq-archive-updated $suite $p
297 >$tmp/aq/package.new.$p
298 t-aq-archive-updated new $p
300 ln -sf $suite $tmp/aq/dsc_in_suite/$sname
302 cat <<END >>$tmp/aq/suites
305 "archive" : "ftp-master",
306 "codename" : "$suite",
319 cat <<END >>$tmp/aq/suites
325 t-aq-archive-updated () {
328 local suitedir=$tmp/aq/dsc_in_suite/$suite
330 perl <$tmp/aq/package.$suite.$p >$suitedir/$p -wne '
334 m{^(\S+) (\w+) ([^ \t/]+)/(\S+)} or die;
342 my $json = JSON->new->canonical();
343 print $json->encode(\@v) or die $!;
348 t-archive-process-incoming () {
350 mv $tmp/incoming/${p}_* $tmp/mirror/pool/main/
351 t-archive-query "$suite"
356 local dscf=main/${p}_${v}.dsc
357 t-archive-query-$t_archive_method "$suite" "$p" "$v" "$dscf"
359 t-archive-query-aq () {
364 local sha; sha=`sha256sum <$tmp/mirror/pool/$dscf`
365 echo "${v} ${sha% -} $dscf" >>$tmp/aq/package.$suite.${p}
366 t-aq-archive-updated $suite $p
372 local dscf=${p}_$2.dsc
373 rm -f $tmp/mirror/pool/main/${p}_*
374 ${t_archive_ln_s-ln -s} \
375 $troot/pkg-srcs/${p}_${2%-*}* $tmp/mirror/pool/main/
376 t-archive-query $suite
379 (set -e; cd $tmp/extract; dpkg-source -x ../mirror/pool/main/$dscf)
382 t-git-dir-time-passes () {
383 touch -d 'last year' $dgitrepo
387 local gitdir=$dgitrepo
390 if test -e "$gitdir"; then fail "$gitdir exists"; fi
393 public) wantstat='7[75]5' ;;
394 secret) wantstat='7[70]0' ;;
395 *) fail "$1 t-git-dir-check ?" ;;
397 gotstat=`stat -c%a $gitdir`
399 *$wantstat) return ;;
400 *) fail "$gitdir has mode $gotstat, expected $wantstat" ;;
404 t-expect-fsck-fail () {
405 echo >>$tmp/fsck.expected-errors "$1"
409 local fsckerrs=$(git rev-parse --git-dir)/dgit-test-fsck.errs
412 LC_MESSAGES=C git fsck --no-dangling --strict 2>&1 \
414 ps="${PIPESTATUS[*]}"
418 if [ -f $tmp/fsck.expected-errors ]; then
419 pats=(-w -f $tmp/fsck.expected-errors)
423 pats+=(-e 'notice: HEAD points to an unborn branch')
424 pats+=(-e 'notice: No default references')
427 grep -v "${pats[@]}" $fsckerrs
431 1) ;; # no unexpected errors
432 0) fail "unexpected messages from git-fsck" ;;
433 *) fail "grep of git-fsck failed" ;;
437 t-check-only-bpd () {
438 if [ "$bpd" = .. ]; then return; fi
440 $tmp/*.{deb,changes,dsc,buildinfo} \
447 for d in $tmp/*/.git $tmp/git/*.git; do
455 : '========================================'
462 t-save-artifacts () {
463 artifacts="$AUTOPKGTEST_ARTIFACTS"
464 if [ x"$artifacts" = x ]; then return; fi
465 if [ x"tmp" = x ]; then return; fi
466 GZIP=-1v tar -C "$tmp" -zc -f "$artifacts/${0##*/}.tar.gz" \
470 t-rm-dput-dropping () {
471 rm -f $tmp/${p}_${v}_*.upload
475 local dgit=${DGIT_TEST-dgit}
478 {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{'
479 $dgit --dgit=$dgit --dget:-u --dput:--config=$tmp/dput.cf \
480 ${dgit_config_debian_alias-"--config-lookup-explode=dgit-distro.debian.alias-canon"} \
481 ${DGIT_GITDEBREBASE_TEST+--git-debrebase=}${DGIT_GITDEBREBASE_TEST} \
482 ${distro+${distro:+-d}}${distro--dtest-dummy} \
483 $DGIT_TEST_OPTS $DGIT_TEST_DEBUG \
484 -kBCD22CD83243B79D3DFAC33EA3DBCBC039B13D8A $t_dgit_xopts "$@"
485 : '}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
489 t-non-dgit-upload () {
490 t-dgit -wgf build-source
493 c=${p}_${v}_source.changes
494 debsign -kBCD22CD83243B79D3DFAC33EA3DBCBC039B13D8A $c
495 dput -c $tmp/dput.cf test-dummy $c
497 t-archive-process-incoming sid
505 (export LC_ALL=C.UTF-8
506 if [ "$DGIT_TEST_INTREE" ]; then
507 make -C $DGIT_TEST_INTREE $page.$section.view
514 diff --exclude=.git --exclude=.pc -ruN $*
517 t-files-notexist () {
526 t-cloned-fetched-good () {
527 t-diff-nogit ../extract/$p-${v%-*} .
528 t-clean-on-branch dgit/sid
531 refs/heads/dgit/sid \
532 refs/remotes/dgit/dgit/sid
533 t-refs-notexist refs/dgit/unstable refs/remotes/dgit/dgit/unstable
537 printf "%s${1:+\n}" "$1" >$tmp/t.want
540 diff $tmp/t.want $tmp/t.got
543 t-clean-on-branch () {
544 t-output "## $1" git status -b --porcelain
552 local import=IMPORT.${DGIT_TEST_TESTNAME-${0##*/}}
553 exec 4>$tmp/$import.new
556 for vn in $savevars; do
557 perl >&4 -"I$root" -MDebian::Dgit -e '
558 printf "%s=%s\n", $ARGV[0], shellquote $ARGV[1]
559 ' $vn "$(eval "printf '%s\n' \"\$$vn\"")"
562 perl >&4 -"I$root" -MDebian::Dgit -we '
563 foreach my $vn (grep m/^DGIT_TEST_REAL_/, keys %ENV) {
564 print STDERR "saving-exporting $vn\n";
565 printf "export %s=%s\n", $vn, shellquote $ENV{$vn}
570 (set -e; cd $tmp; tar cf $import.tar $savedirs)
572 printf >&4 "\n%s\n" "$importeval"
574 mv -f $tmp/$import.new $tmp/$import
582 if [ "x$tmpbase" = x ]; then
583 # ADTTMP was set on entry to tests/lib, so we
584 # are not sharing tmp area between tests
586 lock="$tmp/.dummy.lock"
588 setupsrc="$tmpbase/$setupname"
589 lock="$setupsrc.lock"
592 local simport="$setupsrc/IMPORT.$setupname"
594 if ! [ -e "$simport" ]; then
595 with-lock-ex -w "$lock" \
596 xargs -0 -a $tmp/.save-env \
599 setupname="$1"; shift
601 if [ -e "$simport" ]; then exit 0; fi
603 "tests/setup/$setupname"
604 ' x "$root" "$setupname" "$simport"
607 if [ "x$setupsrc" != "x$tmp" ]; then
608 (set -e; cd $tmp; tar xf "$simport.tar")
611 mkdir -p $tmp/must-clean
616 t-git-get-ref-exact () {
618 # does not dereference, unlike t-git-get-ref
621 *) fail "t-git-get-ref-exact bad $ref" ;;
623 git for-each-ref --format='%(objectname)' "[r]efs/${ref#refs/}"
630 *) fail "t-git-get-ref bad $ref" ;;
632 (git show-ref -d $1 || test $? = 1) | perl -ne '
633 $x = $1 if m#^(\w+) \Q'$1'\E(?:\^\{\})?$#;
634 END { print "$x\n" if length $x; }
638 t-ref-same-exact () {
640 local val; val=`t-git-get-ref-exact $name`
641 t-ref-same-val "$name" $val
646 local val; val=`t-git-get-ref $name`
647 t-ref-same-val "$name" $val
651 local val; val=`git rev-parse HEAD`
652 t-ref-same-val HEAD $val
658 case "${t_ref_val-unset}" in
661 *) fail "ref varies: ($name)\
662 ${val:-nothing} != ${t_ref_val:-nothing} (${t_ref_names[*]})" ;;
665 t_ref_names+=("$name")
668 t-refs-same-start () {
683 val=`t-git-get-ref $g`
684 if [ "x$val" != x ]; then
685 fail "ref $g unexpectedly exists ($val)"
691 echo refs/tags/$tagpfx/${v//\~/_}
695 git log -n1 --pretty=format:"$1" "$2"
698 t-sametree-parent () {
701 local ctree; ctree=$(t-format-ref '%T' "$ref")
704 for parent in $(t-format-ref '%P' "$ref"); do
705 local ptree; ptree=$(t-format-ref '%T' "$parent")
706 if [ "x$ptree" = "x$ctree" ]; then
710 case "$psame" in ""|" * *") break ;; esac
716 t-check-pushed-master () {
717 local master; master=`t-git-get-ref refs/heads/master`
718 if [ x$master = x$t_ref_val ]; then return; fi
719 if [ x$master = x ]; then fail "failed to push master"; fi
720 # didn't update master, it must be not FF
721 local mbase; mbase=`t-git-merge-base $master $t_ref_val`
722 if [ x$mbase = x$master ]; then fail "failed to ff master"; fi
725 t-push-was-source-only () {
727 t-files-notexist $tmp/incoming/${p}_${v}_*.deb \
728 $tmp/incoming/${p}_${v}_*.udeb
729 # we permit _source.buildinfo files; see test_changes_source_only()
730 for f in $tmp/incoming/${p}_${v}_*.buildinfo; do
733 *_source.buildinfo) ;;
734 *) fail "non-source-only file $f exists!" ;;
742 stat $tmp/incoming/$f
748 local suite=${2:-sid}
754 t-pushed-good-core () {
758 refs/remotes/dgit/dgit/$suite
760 refs/heads/dgit/unstable \
761 refs/remotes/dgit/dgit/unstable
762 (set -e; cd $dgitrepo
766 ${t_check_pushed_master:- : NOT-DRS-NO-CHECK-PUSHED-MASTER}
770 git verify-tag `t-v-tag`
773 t-pushed-good-check-changes () {
774 changes_filename="$tmp/incoming/${p}_${v}_*.changes"
775 grep -E "^Distribution: $suite" $changes_filename
776 grep -E "^Version: $v" $changes_filename
779 t-splitbrain-pushed-good--unpack () {
784 ln -s $tmp/mirror/pool/main/*.orig*.tar* .
785 ln -s $tmp/incoming/*.orig*.tar* . ||:
786 ln -s $incoming_dsc .
787 ln -s ${incoming_dsc/.dsc/.debian.tar}* .
788 ln -s ${incoming_dsc/.dsc/.tar}* . ||:
789 dpkg-source "$@" -x *.dsc
792 git fetch ../../$p "refs/tags/*:refs/tags/*"
795 t-splitbrain-pushed-good--checkprep () {
797 git rm --cached -r --ignore-unmatch .pc
800 t-splitbrain-pushed-good--checkdiff () {
802 t-splitbrain-pushed-good--checkprep
803 t-output "" git diff --stat --cached $tag
806 t-splitbrain-pushed-good-start () {
807 dep14tag=refs/tags/test-dummy/${v//\~/_}
809 t-output "" git status --porcelain
811 t-refs-same $dep14tag
812 (set -e; cd $dgitrepo; t-refs-same $dep14tag)
813 git merge-base --is-ancestor $dep14tag $dgittag
816 t-ref-same refs/heads/split.p
817 local split_b=$(t-git-get-ref refs/heads/split.b)
820 "$(git rev-parse refs/heads/split.p^0)") ;;
821 "$(git rev-parse refs/heads/split.p^1)") ;;
822 *) fail "bad b/p (b=$split_b)" ;;
828 t-splitbrain-pushed-good--unpack
829 t-splitbrain-pushed-good--checkdiff $dgittag
831 t-splitbrain-pushed-good-end-made-dep14 () {
832 t-splitbrain-pushed-good--checkdiff $dep14tag
836 t-splitbrain-rm-1-patch () {
839 next unless $_ eq "'"$patchname"'\n";
842 rename "debian/patches/$_", "../t-'"$patchname"'" or die $!;
844 ' debian/patches/series
847 t-splitbrain-rm-gitignore-patch () {
848 t-splitbrain-rm-1-patch auto-gitignore
851 t-gbp-pushed-good () {
852 local suite=${1:-sid}
853 t-splitbrain-pushed-good-start
855 # Right, now we want to check that the maintainer tree and
856 # the dgit tree differ in exactly the ways we expect. We
857 # achieve this by trying to reconstruct the maintainer tree
858 # from the dgit tree.
860 # So, unpack it withut the patches applied
861 t-splitbrain-pushed-good--unpack --skip-patches
863 # dgit might have added a .gitignore patch, which we need to
865 t-splitbrain-rm-gitignore-patch
867 # Now the result should differ only in non-debian/ .gitignores
868 t-splitbrain-pushed-good--checkprep
869 git diff --cached --name-only $dep14tag >../changed
871 next if !m#^debian/# && m#(^|/)\.gitignore#;
875 # If we actually apply the gitignore patch by hand, it
877 if [ -f ../t-auto-gitignore ]; then
878 patch --backup-if-mismatch -p1 -u <../t-auto-gitignore
881 t-splitbrain-pushed-good-end-made-dep14
884 t-unapplied-pushed-good () {
885 local suite=${1:-sid}
886 t-splitbrain-pushed-good-start
887 t-splitbrain-pushed-good--unpack --skip-patches
888 t-splitbrain-pushed-good-end-made-dep14
891 t-dpm-pushed-good () {
892 local suite=${1:-sid}
893 t-splitbrain-pushed-good-start
894 t-splitbrain-pushed-good--unpack
895 t-splitbrain-rm-gitignore-patch
896 t-splitbrain-pushed-good-end-made-dep14
899 t-split-unchanged-pushed-good () {
900 local suite=${1:-sid}
901 t-splitbrain-pushed-good-start
902 t-splitbrain-pushed-good--unpack
903 t-splitbrain-pushed-good-end-made-dep14
906 t-commit-build-push-expect-log () {
912 t-dgit push --new 2>&1 |tee $tmp/push.log
913 t-grep-mpat "$mpat" $tmp/push.log
920 use Dpkg::Control::Hash;
921 my $h = new Dpkg::Control::Hash allow_pgp=>1;
922 $h->parse(\*STDIN,"'"$file"'");
923 my $val = $h->{"'$field'"},"\n";
924 die "'"$file $field"'" unless defined $val;
930 export DGIT_TEST_DISTRO=''
932 t-git-config dgit-suite.unstable.distro test-dummy
942 "") '$var'="$tstunt" ;;
943 *) '$var'="$tstunt:$'$var'" ;;
949 t-tstunt--save-real () {
960 p="${p/:"$tmp/tstunt":/:}"
972 *) fail "did not find $f on PATH $PATH" ;;
975 local varname=${f//[^_0-9a-zA-Z]/_}
976 varname=DGIT_TEST_REAL_${varname^^}
979 : \${$varname:=\$real}
985 local tstunt=$tmp/tstunt
986 t-stunt-envvar PATH $tstunt
987 t-stunt-envvar PERLLIB $tstunt
990 t-tstunt--save-real $f
992 local d="$tstunt/${f%/*}"
994 ln -sf "$troot/tstunt/$f" "$d"/.
998 t-tstunt-parsechangelog () {
999 t-tstunt dpkg-parsechangelog Dpkg/Changelog/Parse.pm
1002 t-tstunt-lintian () {
1006 t-tstunt-debuild () {
1011 local dsc=${p}_${v}.dsc
1012 incoming_dsc=$tmp/incoming/$dsc
1017 local val; val=`t-822-field $incoming_dsc Dgit`
1020 die "Dgit $_ ?" unless m/^\w+\b/;
1021 print $&,"\n" or die $!;
1023 t-ref-same-val $incoming_dsc "$val"
1029 (cd $troot/pkg-srcs;
1030 debdiff ${p}_${v1}.dsc ${p}_${v2}.dsc || test $? = 1) \
1034 t-gbp-unapplied-pq2qc () {
1035 # does `gbp pq export'
1036 # commits the resulting debian/patches on qc/BRANCH
1037 # leaves us on qc/BRANCH (eg "qc/quilt-tip"))
1038 # qc/BRANCH is not fast-forwarding
1042 branch=`git symbolic-ref HEAD`
1043 branch=${branch#refs/heads/}
1046 */*) fail "unexpected branch $branch" ;;
1049 git branch -f qc/$branch
1050 git checkout qc/$branch
1051 git add debian/patches
1052 git commit -m 'Commit patch queue'
1055 t-git-pseudo-merge () {
1056 # like git merge -s ours
1057 if [ ! "$git_pseuomerge_opts" ]; then
1058 if git merge --help \
1059 | grep -q allow-unrelated-histories; then
1060 git_pseuomerge_opts='--allow-unrelated-histories'
1062 git_pseuomerge_opts+=' -s ours'
1064 git merge $git_pseuomerge_opts "$@"
1067 t-gbp-example-prep-no-ff () {
1068 t-archive example 1.0-1
1076 git checkout -b patch-queue/quilt-tip-2 patch-queue/quilt-tip
1079 echo '/* some comment */' >>src.c
1081 git commit -m 'Add a comment to an upstream file'
1083 t-gbp-unapplied-pq2qc
1085 t-commit 'some updates' 1.0-2
1088 t-gbp-example-prep () {
1089 t-gbp-example-prep-no-ff
1091 t-git-pseudo-merge \
1092 -m 'Pseudo-merge to make descendant of archive' \
1093 remotes/dgit/dgit/sid
1096 t-make-badcommit () {
1098 git cat-file commit HEAD | \
1099 perl -pe 's/^committer /commiter /' | \
1100 git hash-object -w -t commit --stdin
1102 t-expect-fsck-fail $badcommit
1106 # leaves ust set to filename of orig tarball
1110 ust=${p}_${v}.orig.tar.gz
1111 GZIP=-1 git archive -o $bpd/$ust --prefix=${p}-${v}/ $tag
1114 t-merge-conflicted-stripping-conflict-markers () {
1115 local otherbranch=$1
1118 t-expect-fail F:"Merge conflict in $file" \
1119 git merge $otherbranch
1121 perl -i~ -ne 'print unless m{^(?:\<\<\<|\>\>\>|===)}' "$file"
1123 git commit --no-edit
1128 v=${2:-${majorv:-1}.$revision}
1129 $troot/tstunt/debchange \
1130 --force-distribution -v$v --distribution ${3:-unstable} "$1"
1131 git add debian/changelog
1133 revision=$(( ${revision-0} + 1 ))
1137 local cmd="$1"; shift
1138 local suite=${1-unstable}
1139 $cmd -r -D "$suite" ''
1143 t-dch-r-rune t-dch-commit "$@"
1147 $troot/tstunt/debchange "$@"
1148 git commit -m "dch $*" debian/changelog
1152 git config --global "$@"
1156 t-git-config dgit-distro.test-dummy.git-url "ext::$troot/drs-git-ext %S "
1157 t-git-config dgit-distro.test-dummy.git-check true
1158 t-git-config dgit-distro.test-dummy.git-create true
1159 cp $troot/gnupg/{dd.gpg,dm.gpg,dm.txt} $tmp/.
1160 cp $troot/suites $tmp/.
1161 cp $troot/suites $tmp/suites-master
1163 export t_check_pushed_master=t-check-pushed-master
1165 drs_dispatch=$tmp/distro=test-dummy
1168 if [ "x$DGIT_TEST_INTREE" != x ]; then
1169 ln -sf "$DGIT_TEST_INTREE" $drs_dispatch/dgit-live
1172 ln -sf $tmp/git $drs_dispatch/repos
1173 ln -sf $tmp/suites $tmp/suites-master $tmp/dm.txt $drs_dispatch/
1174 mkdir -p $drs_dispatch/keyrings
1175 ln -sf $tmp/dd.gpg $drs_dispatch/keyrings/debian-keyring.gpg
1176 ln -sf $tmp/dm.gpg $drs_dispatch/keyrings/debian-maintainers.gpg
1177 ln -sf /bin/true $drs_dispatch/policy-hook
1182 t-git-config dgit-distro.test-dummy.ssh "$troot/dsd-ssh"
1183 t-git-config dgit-distro.test-dummy.git-check ssh-cmd
1184 t-git-config dgit-distro.test-dummy.git-create true
1185 t-git-config dgit-distro.test-dummy.git-url \
1186 "ext::$troot/dsd-ssh X %S /dgit/test-dummy/repos"
1188 t-git-config dgit-distro.test-dummy.diverts.drs /drs
1189 t-git-config dgit-distro.test-dummy/drs.ssh "$troot/ssh"
1190 t-git-config dgit-distro.test-dummy/drs.git-url $tmp/git
1191 t-git-config dgit-distro.test-dummy/drs.git-check ssh-cmd
1192 t-git-config dgit-distro.test-dummy/drs.git-create ssh-cmd
1194 echo 'no-such-package* drs' >$drs_dispatch/diverts
1198 : '(((((((((((((((((((((((((((((((((((((((('
1199 ${DGIT_INFRA_PFX}dgit-repos-admin-debian --repos $tmp/git "$@"
1200 : '))))))))))))))))))))))))))))))))))))))))'
1203 t-policy-nonexist () {
1204 ln -sf no-such-file-or-directory $drs_dispatch/policy-hook
1207 t-make-hook-link () {
1208 local hook=$1 # in infra/
1210 hook=${DGIT_INFRA_PFX}$hook
1213 *) hook=`type -P $hook` ;;
1215 ln -sf "$hook" $linkpath
1220 t-make-hook-link $policyhook $drs_dispatch/policy-hook
1225 t-policy dgit-repos-policy-debian
1228 t-policy-admin create-db
1231 t-policy-periodic () {
1232 : '(((((((((((((((((((((((((((((((((((((((('
1233 ${DGIT_REPOS_SERVER_TEST-dgit-repos-server} \
1234 test-dummy $drs_dispatch '' --cron
1235 : '))))))))))))))))))))))))))))))))))))))))'
1238 t-tagupl-settings () {
1239 export DGIT_DRS_EMAIL_NOREPLY=noreply@example.org
1240 export DGIT_DRS_SENDMAIL=$troot/tstunt/sendmail
1241 export DGIT_DRS_DGIT=$troot/tstunt/dgit
1242 t-chain-test-somehow
1244 mkdir ../pretend-salsa
1245 (set -e; cd ../pretend-salsa; git init --bare)
1246 git remote add salsa $tmp/pretend-salsa
1247 # git branch --set-upstream-to complains, so
1248 git config branch.master.remote salsa
1249 git config branch.master.merge refs/heads/master
1252 t-tagupl-run-drs () {
1257 DGIT_DRS_ANY_URL=1 \
1258 DGIT_DRS_MODE="tag2upload $source $tagname" \
1265 ${DGIT_DEBPUSH_TEST-git debpush} \
1266 --distro=test-dummy -u Senatus "$@"
1269 t-tagupl-run-drs $tmp/pretend-salsa
1272 t-refs-same refs/heads/master
1278 t-buildproductsdir-config () {
1280 t-git-config dgit.default.build-products-dir $bpd
1282 cat <<END >>$tmp/.gbp.conf
1289 local restriction=$1
1290 (cd $root; t-restriction-$restriction >&2)
1294 : "Hopefully installed: $*"
1297 t-chain-test-somehow () {
1298 export DGIT_TEST_TESTNAME="$testname"
1299 export DGIT_TEST_TMPBASE="$tmpbase"
1304 t-chain-test-somehow
1314 t-chain-test "${t#*-}"
1317 t-git-config dgit.default.old-dsc-distro test-dummy
1319 for import in ${autoimport-gnupg}; do
1323 t-setup-import $import