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 ${t_archive_ln_s-ln -s} \
366 $troot/pkg-srcs/${p}_${2%-*}* $tmp/mirror/pool/main/
367 t-archive-query $suite
370 (set -e; cd $tmp/extract; dpkg-source -x ../mirror/pool/main/$dscf)
373 t-git-dir-time-passes () {
374 touch -d 'last year' $dgitrepo
378 local gitdir=$dgitrepo
381 if test -e "$gitdir"; then fail "$gitdir exists"; fi
384 public) wantstat='7[75]5' ;;
385 secret) wantstat='7[70]0' ;;
386 *) fail "$1 t-git-dir-check ?" ;;
388 gotstat=`stat -c%a $gitdir`
390 *$wantstat) return ;;
391 *) fail "$gitdir has mode $gotstat, expected $wantstat" ;;
395 t-expect-fsck-fail () {
396 echo >>$tmp/fsck.expected-errors "$1"
400 local fsckerrs=$(git rev-parse --git-dir)/dgit-test-fsck.errs
403 LC_MESSAGES=C git fsck --no-dangling --strict 2>&1 \
405 ps="${PIPESTATUS[*]}"
409 if [ -f $tmp/fsck.expected-errors ]; then
410 pats=(-w -f $tmp/fsck.expected-errors)
414 pats+=(-e 'notice: HEAD points to an unborn branch')
415 pats+=(-e 'notice: No default references')
418 grep -v "${pats[@]}" $fsckerrs
422 1) ;; # no unexpected errors
423 0) fail "unexpected messages from git-fsck" ;;
424 *) fail "grep of git-fsck failed" ;;
428 t-check-only-bpd () {
429 if [ "$bpd" = .. ]; then return; fi
431 $tmp/*.{deb,changes,dsc,buildinfo} \
438 for d in $tmp/*/.git $tmp/git/*.git; do
446 : '========================================'
453 t-save-artifacts () {
454 artifacts="$AUTOPKGTEST_ARTIFACTS"
455 if [ x"$artifacts" = x ]; then return; fi
456 if [ x"tmp" = x ]; then return; fi
457 GZIP=-1v tar -C "$tmp" -zc -f "$artifacts/${0##*/}.tar.gz" \
461 t-rm-dput-dropping () {
462 rm -f $tmp/${p}_${v}_*.upload
466 local dgit=${DGIT_TEST-dgit}
469 {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{'
470 $dgit --dgit=$dgit --dget:-u --dput:--config=$tmp/dput.cf \
471 ${dgit_config_debian_alias-"--config-lookup-explode=dgit-distro.debian.alias-canon"} \
472 ${DGIT_GITDEBREBASE_TEST+--git-debrebase=}${DGIT_GITDEBREBASE_TEST} \
473 ${distro+${distro:+-d}}${distro--dtest-dummy} \
474 $DGIT_TEST_OPTS $DGIT_TEST_DEBUG \
475 -kBCD22CD83243B79D3DFAC33EA3DBCBC039B13D8A $t_dgit_xopts "$@"
476 : '}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
480 t-non-dgit-upload () {
481 t-dgit -wgf build-source
484 c=${p}_${v}_source.changes
485 debsign -kBCD22CD83243B79D3DFAC33EA3DBCBC039B13D8A $c
486 dput -c $tmp/dput.cf test-dummy $c
488 t-archive-process-incoming sid
496 (export LC_ALL=C.UTF-8
497 if [ "$DGIT_TEST_INTREE" ]; then
498 make -C $DGIT_TEST_INTREE $page.$section.view
505 diff --exclude=.git --exclude=.pc -ruN $*
508 t-files-notexist () {
517 t-cloned-fetched-good () {
518 t-diff-nogit ../extract/$p-${v%-*} .
519 t-clean-on-branch dgit/sid
522 refs/heads/dgit/sid \
523 refs/remotes/dgit/dgit/sid
524 t-refs-notexist refs/dgit/unstable refs/remotes/dgit/dgit/unstable
528 printf "%s${1:+\n}" "$1" >$tmp/t.want
531 diff $tmp/t.want $tmp/t.got
534 t-clean-on-branch () {
535 t-output "## $1" git status -b --porcelain
543 local import=IMPORT.${DGIT_TEST_TESTNAME-${0##*/}}
544 exec 4>$tmp/$import.new
547 for vn in $savevars; do
548 perl >&4 -"I$root" -MDebian::Dgit -e '
549 printf "%s=%s\n", $ARGV[0], shellquote $ARGV[1]
550 ' $vn "$(eval "printf '%s\n' \"\$$vn\"")"
553 perl >&4 -"I$root" -MDebian::Dgit -we '
554 foreach my $vn (grep m/^DGIT_TEST_REAL_/, keys %ENV) {
555 print STDERR "saving-exporting $vn\n";
556 printf "export %s=%s\n", $vn, shellquote $ENV{$vn}
561 (set -e; cd $tmp; tar cf $import.tar $savedirs)
563 printf >&4 "\n%s\n" "$importeval"
565 mv -f $tmp/$import.new $tmp/$import
573 if [ "x$tmpbase" = x ]; then
574 # ADTTMP was set on entry to tests/lib, so we
575 # are not sharing tmp area between tests
577 lock="$tmp/.dummy.lock"
579 setupsrc="$tmpbase/$setupname"
580 lock="$setupsrc.lock"
583 local simport="$setupsrc/IMPORT.$setupname"
585 if ! [ -e "$simport" ]; then
586 with-lock-ex -w "$lock" \
587 xargs -0 -a $tmp/.save-env \
590 setupname="$1"; shift
592 if [ -e "$simport" ]; then exit 0; fi
594 "tests/setup/$setupname"
595 ' x "$root" "$setupname" "$simport"
598 if [ "x$setupsrc" != "x$tmp" ]; then
599 (set -e; cd $tmp; tar xf "$simport.tar")
602 mkdir -p $tmp/must-clean
607 t-git-get-ref-exact () {
609 # does not dereference, unlike t-git-get-ref
612 *) fail "t-git-get-ref-exact bad $ref" ;;
614 git for-each-ref --format='%(objectname)' "[r]efs/${ref#refs/}"
621 *) fail "t-git-get-ref bad $ref" ;;
623 (git show-ref -d $1 || test $? = 1) | perl -ne '
624 $x = $1 if m#^(\w+) \Q'$1'\E(?:\^\{\})?$#;
625 END { print "$x\n" if length $x; }
629 t-ref-same-exact () {
631 local val; val=`t-git-get-ref-exact $name`
632 t-ref-same-val "$name" $val
637 local val; val=`t-git-get-ref $name`
638 t-ref-same-val "$name" $val
642 local val; val=`git rev-parse HEAD`
643 t-ref-same-val HEAD $val
649 case "${t_ref_val-unset}" in
652 *) fail "ref varies: ($name)\
653 ${val:-nothing} != ${t_ref_val:-nothing} (${t_ref_names[*]})" ;;
656 t_ref_names+=("$name")
659 t-refs-same-start () {
674 val=`t-git-get-ref $g`
675 if [ "x$val" != x ]; then
676 fail "ref $g unexpectedly exists ($val)"
682 echo refs/tags/$tagpfx/${v//\~/_}
686 git log -n1 --pretty=format:"$1" "$2"
689 t-sametree-parent () {
692 local ctree; ctree=$(t-format-ref '%T' "$ref")
695 for parent in $(t-format-ref '%P' "$ref"); do
696 local ptree; ptree=$(t-format-ref '%T' "$parent")
697 if [ "x$ptree" = "x$ctree" ]; then
701 case "$psame" in ""|" * *") break ;; esac
707 t-check-pushed-master () {
708 local master; master=`t-git-get-ref refs/heads/master`
709 if [ x$master = x$t_ref_val ]; then return; fi
710 if [ x$master = x ]; then fail "failed to push master"; fi
711 # didn't update master, it must be not FF
712 local mbase; mbase=`t-git-merge-base $master $t_ref_val`
713 if [ x$mbase = x$master ]; then fail "failed to ff master"; fi
716 t-push-was-source-only () {
718 t-files-notexist $tmp/incoming/${p}_${v}_*.deb \
719 $tmp/incoming/${p}_${v}_*.udeb
720 # we permit _source.buildinfo files; see test_changes_source_only()
721 for f in $tmp/incoming/${p}_${v}_*.buildinfo; do
724 *_source.buildinfo) ;;
725 *) fail "non-source-only file $f exists!" ;;
733 stat $tmp/incoming/$f
739 local suite=${2:-sid}
745 t-pushed-good-core () {
749 refs/remotes/dgit/dgit/$suite
751 refs/heads/dgit/unstable \
752 refs/remotes/dgit/dgit/unstable
753 (set -e; cd $dgitrepo
757 ${t_check_pushed_master:- : NOT-DRS-NO-CHECK-PUSHED-MASTER}
761 git verify-tag `t-v-tag`
764 t-pushed-good-check-changes () {
765 changes_filename="$tmp/incoming/${p}_${v}_*.changes"
766 grep -E "^Distribution: $suite" $changes_filename
767 grep -E "^Version: $v" $changes_filename
770 t-splitbrain-pushed-good--unpack () {
775 ln -s $tmp/mirror/pool/main/*.orig*.tar* .
776 ln -s $tmp/incoming/*.orig*.tar* . ||:
777 ln -s $incoming_dsc .
778 ln -s ${incoming_dsc/.dsc/.debian.tar}* .
779 ln -s ${incoming_dsc/.dsc/.tar}* . ||:
780 dpkg-source "$@" -x *.dsc
783 git fetch ../../$p "refs/tags/*:refs/tags/*"
786 t-splitbrain-pushed-good--checkprep () {
788 git rm --cached -r --ignore-unmatch .pc
791 t-splitbrain-pushed-good--checkdiff () {
793 t-splitbrain-pushed-good--checkprep
794 t-output "" git diff --stat --cached $tag
797 t-splitbrain-pushed-good-start () {
798 dep14tag=refs/tags/test-dummy/${v//\~/_}
800 t-output "" git status --porcelain
802 t-refs-same $dep14tag
803 (set -e; cd $dgitrepo; t-refs-same $dep14tag)
804 git merge-base --is-ancestor $dep14tag $dgittag
807 t-ref-same refs/heads/split.p
808 local split_b=$(t-git-get-ref refs/heads/split.b)
811 "$(git rev-parse refs/heads/split.p^0)") ;;
812 "$(git rev-parse refs/heads/split.p^1)") ;;
813 *) fail "bad b/p (b=$split_b)" ;;
819 t-splitbrain-pushed-good--unpack
820 t-splitbrain-pushed-good--checkdiff $dgittag
822 t-splitbrain-pushed-good-end-made-dep14 () {
823 t-splitbrain-pushed-good--checkdiff $dep14tag
827 t-splitbrain-rm-1-patch () {
830 next unless $_ eq "'"$patchname"'\n";
833 rename "debian/patches/$_", "../t-'"$patchname"'" or die $!;
835 ' debian/patches/series
838 t-splitbrain-rm-gitignore-patch () {
839 t-splitbrain-rm-1-patch auto-gitignore
842 t-gbp-pushed-good () {
843 local suite=${1:-sid}
844 t-splitbrain-pushed-good-start
846 # Right, now we want to check that the maintainer tree and
847 # the dgit tree differ in exactly the ways we expect. We
848 # achieve this by trying to reconstruct the maintainer tree
849 # from the dgit tree.
851 # So, unpack it withut the patches applied
852 t-splitbrain-pushed-good--unpack --skip-patches
854 # dgit might have added a .gitignore patch, which we need to
856 t-splitbrain-rm-gitignore-patch
858 # Now the result should differ only in non-debian/ .gitignores
859 t-splitbrain-pushed-good--checkprep
860 git diff --cached --name-only $dep14tag >../changed
862 next if !m#^debian/# && m#(^|/)\.gitignore#;
866 # If we actually apply the gitignore patch by hand, it
868 if [ -f ../t-auto-gitignore ]; then
869 patch --backup-if-mismatch -p1 -u <../t-auto-gitignore
872 t-splitbrain-pushed-good-end-made-dep14
875 t-unapplied-pushed-good () {
876 local suite=${1:-sid}
877 t-splitbrain-pushed-good-start
878 t-splitbrain-pushed-good--unpack --skip-patches
879 t-splitbrain-pushed-good-end-made-dep14
882 t-dpm-pushed-good () {
883 local suite=${1:-sid}
884 t-splitbrain-pushed-good-start
885 t-splitbrain-pushed-good--unpack
886 t-splitbrain-rm-gitignore-patch
887 t-splitbrain-pushed-good-end-made-dep14
890 t-split-unchanged-pushed-good () {
891 local suite=${1:-sid}
892 t-splitbrain-pushed-good-start
893 t-splitbrain-pushed-good--unpack
894 t-splitbrain-pushed-good-end-made-dep14
897 t-commit-build-push-expect-log () {
903 t-dgit push --new 2>&1 |tee $tmp/push.log
904 t-grep-mpat "$mpat" $tmp/push.log
911 use Dpkg::Control::Hash;
912 my $h = new Dpkg::Control::Hash allow_pgp=>1;
913 $h->parse(\*STDIN,"'"$file"'");
914 my $val = $h->{"'$field'"},"\n";
915 die "'"$file $field"'" unless defined $val;
921 export DGIT_TEST_DISTRO=''
923 t-git-config dgit-suite.unstable.distro test-dummy
933 "") '$var'="$tstunt" ;;
934 *) '$var'="$tstunt:$'$var'" ;;
940 t-tstunt--save-real () {
951 p="${p/:"$tmp/tstunt":/:}"
963 *) fail "did not find $f on PATH $PATH" ;;
966 local varname=${f//[^_0-9a-zA-Z]/_}
967 varname=DGIT_TEST_REAL_${varname^^}
970 : \${$varname:=\$real}
976 local tstunt=$tmp/tstunt
977 t-stunt-envvar PATH $tstunt
978 t-stunt-envvar PERLLIB $tstunt
981 t-tstunt--save-real $f
983 local d="$tstunt/${f%/*}"
985 ln -sf "$troot/tstunt/$f" "$d"/.
989 t-tstunt-parsechangelog () {
990 t-tstunt dpkg-parsechangelog Dpkg/Changelog/Parse.pm
993 t-tstunt-lintian () {
997 t-tstunt-debuild () {
1002 local dsc=${p}_${v}.dsc
1003 incoming_dsc=$tmp/incoming/$dsc
1008 local val; val=`t-822-field $incoming_dsc Dgit`
1011 die "Dgit $_ ?" unless m/^\w+\b/;
1012 print $&,"\n" or die $!;
1014 t-ref-same-val $incoming_dsc "$val"
1020 (cd $troot/pkg-srcs;
1021 debdiff ${p}_${v1}.dsc ${p}_${v2}.dsc || test $? = 1) \
1025 t-gbp-unapplied-pq2qc () {
1026 # does `gbp pq export'
1027 # commits the resulting debian/patches on qc/BRANCH
1028 # leaves us on qc/BRANCH (eg "qc/quilt-tip"))
1029 # qc/BRANCH is not fast-forwarding
1033 branch=`git symbolic-ref HEAD`
1034 branch=${branch#refs/heads/}
1037 */*) fail "unexpected branch $branch" ;;
1040 git branch -f qc/$branch
1041 git checkout qc/$branch
1042 git add debian/patches
1043 git commit -m 'Commit patch queue'
1046 t-git-pseudo-merge () {
1047 # like git merge -s ours
1048 if [ ! "$git_pseuomerge_opts" ]; then
1049 if git merge --help \
1050 | grep -q allow-unrelated-histories; then
1051 git_pseuomerge_opts='--allow-unrelated-histories'
1053 git_pseuomerge_opts+=' -s ours'
1055 git merge $git_pseuomerge_opts "$@"
1058 t-gbp-example-prep-no-ff () {
1059 t-archive example 1.0-1
1067 git checkout -b patch-queue/quilt-tip-2 patch-queue/quilt-tip
1070 echo '/* some comment */' >>src.c
1072 git commit -m 'Add a comment to an upstream file'
1074 t-gbp-unapplied-pq2qc
1076 t-commit 'some updates' 1.0-2
1079 t-gbp-example-prep () {
1080 t-gbp-example-prep-no-ff
1082 t-git-pseudo-merge \
1083 -m 'Pseudo-merge to make descendant of archive' \
1084 remotes/dgit/dgit/sid
1087 t-make-badcommit () {
1089 git cat-file commit HEAD | \
1090 perl -pe 's/^committer /commiter /' | \
1091 git hash-object -w -t commit --stdin
1093 t-expect-fsck-fail $badcommit
1097 # leaves ust set to filename of orig tarball
1101 ust=${p}_${v}.orig.tar.gz
1102 GZIP=-1 git archive -o $bpd/$ust --prefix=${p}-${v}/ $tag
1105 t-merge-conflicted-stripping-conflict-markers () {
1106 local otherbranch=$1
1109 t-expect-fail F:"Merge conflict in $file" \
1110 git merge $otherbranch
1112 perl -i~ -ne 'print unless m{^(?:\<\<\<|\>\>\>|===)}' "$file"
1114 git commit --no-edit
1119 v=${2:-${majorv:-1}.$revision}
1120 $troot/tstunt/debchange \
1121 --force-distribution -v$v --distribution ${3:-unstable} "$1"
1122 git add debian/changelog
1124 revision=$(( ${revision-0} + 1 ))
1128 local cmd="$1"; shift
1129 local suite=${1-unstable}
1130 $cmd -r -D "$suite" ''
1134 t-dch-r-rune t-dch-commit "$@"
1138 $troot/tstunt/debchange "$@"
1139 git commit -m "dch $*" debian/changelog
1143 git config --global "$@"
1147 t-git-config dgit-distro.test-dummy.git-url "ext::$troot/drs-git-ext %S "
1148 t-git-config dgit-distro.test-dummy.git-check true
1149 t-git-config dgit-distro.test-dummy.git-create true
1150 cp $troot/gnupg/{dd.gpg,dm.gpg,dm.txt} $tmp/.
1151 cp $troot/suites $tmp/.
1152 cp $troot/suites $tmp/suites-master
1154 export t_check_pushed_master=t-check-pushed-master
1156 drs_dispatch=$tmp/distro=test-dummy
1159 if [ "x$DGIT_TEST_INTREE" != x ]; then
1160 ln -sf "$DGIT_TEST_INTREE" $drs_dispatch/dgit-live
1163 ln -sf $tmp/git $drs_dispatch/repos
1164 ln -sf $tmp/suites $tmp/suites-master $tmp/dm.txt $drs_dispatch/
1165 mkdir -p $drs_dispatch/keyrings
1166 ln -sf $tmp/dd.gpg $drs_dispatch/keyrings/debian-keyring.gpg
1167 ln -sf $tmp/dm.gpg $drs_dispatch/keyrings/debian-maintainers.gpg
1168 ln -sf /bin/true $drs_dispatch/policy-hook
1173 t-git-config dgit-distro.test-dummy.ssh "$troot/dsd-ssh"
1174 t-git-config dgit-distro.test-dummy.git-check ssh-cmd
1175 t-git-config dgit-distro.test-dummy.git-create true
1176 t-git-config dgit-distro.test-dummy.git-url \
1177 "ext::$troot/dsd-ssh X %S /dgit/test-dummy/repos"
1179 t-git-config dgit-distro.test-dummy.diverts.drs /drs
1180 t-git-config dgit-distro.test-dummy/drs.ssh "$troot/ssh"
1181 t-git-config dgit-distro.test-dummy/drs.git-url $tmp/git
1182 t-git-config dgit-distro.test-dummy/drs.git-check ssh-cmd
1183 t-git-config dgit-distro.test-dummy/drs.git-create ssh-cmd
1185 echo 'no-such-package* drs' >$drs_dispatch/diverts
1189 : '(((((((((((((((((((((((((((((((((((((((('
1190 ${DGIT_INFRA_PFX}dgit-repos-admin-debian --repos $tmp/git "$@"
1191 : '))))))))))))))))))))))))))))))))))))))))'
1194 t-policy-nonexist () {
1195 ln -sf no-such-file-or-directory $drs_dispatch/policy-hook
1198 t-make-hook-link () {
1199 local hook=$1 # in infra/
1201 hook=${DGIT_INFRA_PFX}$hook
1204 *) hook=`type -P $hook` ;;
1206 ln -sf "$hook" $linkpath
1211 t-make-hook-link $policyhook $drs_dispatch/policy-hook
1216 t-policy dgit-repos-policy-debian
1219 t-policy-admin create-db
1222 t-policy-periodic () {
1223 : '(((((((((((((((((((((((((((((((((((((((('
1224 ${DGIT_REPOS_SERVER_TEST-dgit-repos-server} \
1225 test-dummy $drs_dispatch '' --cron
1226 : '))))))))))))))))))))))))))))))))))))))))'
1229 t-tagupl-settings () {
1230 export DGIT_DRS_EMAIL_NOREPLY=noreply@example.org
1231 export DGIT_DRS_SENDMAIL=$troot/tstunt/sendmail
1232 export DGIT_DRS_DGIT=$troot/tstunt/dgit
1233 t-chain-test-somehow
1235 mkdir ../pretend-salsa
1236 (set -e; cd ../pretend-salsa; git init --bare)
1237 git remote add salsa $tmp/pretend-salsa
1238 # git branch --set-upstream-to complains, so
1239 git config branch.master.remote salsa
1240 git config branch.master.merge refs/heads/master
1243 t-tagupl-run-drs () {
1248 DGIT_DRS_ANY_URL=1 \
1249 DGIT_DRS_MODE="tag2upload $source $tagname" \
1256 ${DGIT_DEBPUSH_TEST-git debpush} \
1257 --distro=test-dummy -u Senatus "$@"
1260 t-tagupl-run-drs $tmp/pretend-salsa
1263 t-refs-same refs/heads/master
1269 t-buildproductsdir-config () {
1271 t-git-config dgit.default.build-products-dir $bpd
1273 cat <<END >>$tmp/.gbp.conf
1280 local restriction=$1
1281 (cd $root; t-restriction-$restriction >&2)
1285 : "Hopefully installed: $*"
1288 t-chain-test-somehow () {
1289 export DGIT_TEST_TESTNAME="$testname"
1290 export DGIT_TEST_TMPBASE="$tmpbase"
1295 t-chain-test-somehow
1305 t-chain-test "${t#*-}"
1308 t-git-config dgit.default.old-dsc-distro test-dummy
1310 for import in ${autoimport-gnupg}; do
1314 t-setup-import $import