summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/git-srcs/pari-extra_3-1.git.tarbin40960 -> 40960 bytes
-rwxr-xr-xtests/http-static-server7
-rw-r--r--tests/lib76
-rw-r--r--tests/lib-baredebian3
-rw-r--r--tests/lib-core1
-rw-r--r--tests/lib-orig-include-exclude2
-rw-r--r--tests/pkg-srcs/example_1.0-1+absurd.debian.tar.xzbin1416 -> 1528 bytes
-rw-r--r--tests/pkg-srcs/example_1.0-1+absurd.dsc6
-rw-r--r--tests/pkg-srcs/example_1.0-1+brokenmeta.debian.tar.xzbin1304 -> 1304 bytes
-rw-r--r--tests/pkg-srcs/example_1.0-1+brokenmeta.dsc6
-rw-r--r--tests/pkg-srcs/example_1.0-1.100.debian.tar.xzbin2108 -> 2156 bytes
-rw-r--r--tests/pkg-srcs/example_1.0-1.100.dsc6
-rw-r--r--tests/pkg-srcs/example_1.0-1.debian.tar.xzbin1304 -> 1300 bytes
-rw-r--r--tests/pkg-srcs/example_1.0-1.dsc6
-rw-r--r--tests/pkg-srcs/pari-extra_3-1.diff.gzbin2358 -> 2357 bytes
-rw-r--r--tests/pkg-srcs/pari-extra_3-1.dsc27
-rw-r--r--tests/pkg-srcs/pari-extra_3-2~dummy1.diff.gzbin2484 -> 2486 bytes
-rw-r--r--tests/pkg-srcs/pari-extra_3-2~dummy1.dsc16
-rw-r--r--tests/pkg-srcs/ruby-rails-3.2_3.2.6-1.debian.tar.gzbin2297 -> 0 bytes
-rw-r--r--tests/pkg-srcs/ruby-rails-3.2_3.2.6-1.debian.tar.xzbin0 -> 2252 bytes
-rw-r--r--tests/pkg-srcs/ruby-rails-3.2_3.2.6-1.dsc30
-rw-r--r--tests/pkg-srcs/sunxi-tools_1.2-2.~~dgittest.debian.tar.gzbin5182 -> 0 bytes
-rw-r--r--tests/pkg-srcs/sunxi-tools_1.2-2.~~dgittest.debian.tar.xzbin0 -> 4892 bytes
-rw-r--r--tests/pkg-srcs/sunxi-tools_1.2-2.~~dgittest.dsc16
-rwxr-xr-xtests/run-all2
-rwxr-xr-xtests/setup/examplegit2
-rwxr-xr-xtests/tests/badcommit-rewrite62
-rwxr-xr-xtests/tests/clone-nogit3
-rwxr-xr-xtests/tests/debpolicy-dbretry4
-rwxr-xr-xtests/tests/debpolicy-newreject41
-rwxr-xr-xtests/tests/debpolicy-taintrm15
-rwxr-xr-xtests/tests/distropatches-reject6
-rwxr-xr-xtests/tests/dpkgsourceignores-correct2
-rwxr-xr-xtests/tests/drs-push-masterupdate4
-rwxr-xr-xtests/tests/drs-push-rejects24
-rwxr-xr-xtests/tests/gbp-orig4
-rwxr-xr-xtests/tests/gdr-edits2
-rwxr-xr-xtests/tests/gdr-fresh11
-rwxr-xr-xtests/tests/gdr-import-dgitview16
-rwxr-xr-xtests/tests/gdr-import-nostitch2
-rwxr-xr-xtests/tests/gdr-merge-conflicts4
-rwxr-xr-xtests/tests/gitworktree4
-rwxr-xr-xtests/tests/i18n-messages3
-rwxr-xr-xtests/tests/import-linkorigs16
-rwxr-xr-xtests/tests/import-pushold37
-rwxr-xr-xtests/tests/import-r1clog94
-rwxr-xr-xtests/tests/manpages-format1
-rwxr-xr-xtests/tests/mirror2
-rwxr-xr-xtests/tests/mirror-debnewgit2
-rwxr-xr-xtests/tests/mirror-private3
-rwxr-xr-xtests/tests/mismatches-contents4
-rwxr-xr-xtests/tests/mismatches-dscchanges4
-rwxr-xr-xtests/tests/overwrite-chkclog8
-rwxr-xr-xtests/tests/overwrite-junk2
-rwxr-xr-xtests/tests/overwrite-splitbrains6
-rwxr-xr-xtests/tests/overwrite-version4
-rwxr-xr-xtests/tests/pbuilder2
-rwxr-xr-xtests/tests/push-buildproductsdir2
-rwxr-xr-xtests/tests/push-newpackage6
-rwxr-xr-xtests/tests/push-newrepeat4
-rwxr-xr-xtests/tests/push-nextdgit2
-rwxr-xr-xtests/tests/push-source3
-rwxr-xr-xtests/tests/quilt2
-rwxr-xr-xtests/tests/quilt-colour19
-rwxr-xr-xtests/tests/quilt-gbp6
-rwxr-xr-xtests/tests/quilt-include-binaries130
-rwxr-xr-xtests/tests/quilt-singlepatch4
-rwxr-xr-xtests/tests/quilt-splitbrains9
-rwxr-xr-xtests/tests/rpush27
-rwxr-xr-xtests/tests/rpush-quilt2
-rwxr-xr-xtests/tests/rpush-source27
-rwxr-xr-xtests/tests/sbuild-gitish1
-rwxr-xr-xtests/tests/sourceonlypolicy2
-rwxr-xr-xtests/tests/tag-updates3
-rwxr-xr-xtests/tests/tagupl17
-rwxr-xr-xtests/tests/trustingpolicy-replay15
-rwxr-xr-xtests/tests/unrepresentable137
-rwxr-xr-xtests/tests/unrepresentable-single-dpkg4
-rwxr-xr-xtests/tests/unrepresentable-single-git4
-rwxr-xr-xtests/tests/version-opt3
-rw-r--r--tests/tstunt/Dpkg/Changelog/Parse.pm2
-rwxr-xr-xtests/update-dh-compat120
-rwxr-xr-xtests/update-dh-compat-adjust26
-rw-r--r--tests/worktrees/example_1.0.tarbin92160 -> 71680 bytes
-rw-r--r--tests/worktrees/example_1.1.tarbin81920 -> 81920 bytes
-rw-r--r--tests/worktrees/pari-extra_3-1.tarbin81920 -> 71680 bytes
-rw-r--r--tests/worktrees/pari-extra_drs.tarbin153600 -> 112640 bytes
-rw-r--r--tests/worktrees/ruby-rails-3.2_test.tarbin215040 -> 92160 bytes
88 files changed, 895 insertions, 280 deletions
diff --git a/tests/git-srcs/pari-extra_3-1.git.tar b/tests/git-srcs/pari-extra_3-1.git.tar
index 6392d83..7380353 100644
--- a/tests/git-srcs/pari-extra_3-1.git.tar
+++ b/tests/git-srcs/pari-extra_3-1.git.tar
Binary files differ
diff --git a/tests/http-static-server b/tests/http-static-server
index f2f7cd0..723114e 100755
--- a/tests/http-static-server
+++ b/tests/http-static-server
@@ -71,10 +71,11 @@ sub handle_request {
if (!$self->serve_static($cgi, $::webroot)) {
print "HTTP/1.0 404 Not found\r\n";
- print $cgi->header,
- $cgi->start_html('Not found'),
+ print $cgi->header;
+ print $cgi->start_html('Not found'),
$cgi->h1('Not found'),
- $cgi->end_html;
+ $cgi->end_html
+ if uc $cgi->request_method eq 'GET';
}
}
diff --git a/tests/lib b/tests/lib
index 749509c..2731f1e 100644
--- a/tests/lib
+++ b/tests/lib
@@ -1,7 +1,6 @@
#
exec 2>&1
-set -x
set -o pipefail
. tests/lib-core
@@ -25,21 +24,42 @@ END
trap '
rc=$?
set +x
+ redirected_log="$DGIT_TEST_REDIRECTED_LOG"
+ if [ "$redirected_log" ]; then
+ exec 2>&5 >&2
+ unset DGIT_TEST_REDIRECTED_LOG
+ cat -- "$redirected_log" ||:
+ fi
test $rc = 0 || echo "
%%%%%%%%%%%%%%%%%%%% EXITING $rc %%%%%%%%%%%%%%%%%%%%
Most relevant logs are just before assignment rc=$rc
Will now do cleanup etc.
"
- set -x
+ if [ $rc != 0 ] || ! [ "$DGIT_TRAP_QUIET" ]; then
+ set -x
+ pwd
+ fi
set +e
- pwd
[ "x$DGIT_TEST_KEEP_MUSTCLEAN" != x ] || \
[ "x$DGIT_TEST_TMP" = x ] || rm -rf $DGIT_TEST_TMP/must-clean
set -e
test $rc = 0 || t-report-failure
' EXIT
+if [ "$AUTOPKGTEST_ARTIFACTS" ] && ! [ "$DGIT_TEST_REDIRECTED_LOG" ] \
+ && ! [ "$DGIT_TEST_DIRECT_LOG" ]; then
+ # When running under real autopkgtest, don't spew our megabytes of
+ # logs unconditionally. Redirect them to a file, and print them
+ # only on failure. On success, t-save-artifacts comppresses them.
+ exec 5>&2
+ export DGIT_TEST_REDIRECTED_LOG="$AUTOPKGTEST_ARTIFACTS"/"${0##*/}.log"
+ exec >"$DGIT_TEST_REDIRECTED_LOG"
+ exec 2>&1
+fi
+
+set -x
+
t-filter-out-git-hyphen-dir
t-set-intree
@@ -58,6 +78,10 @@ export GIT_AUTHOR_DATE='1530000000 +0100'
export LC_CTYPE=C.UTF-8
unset CDPATH
+# We use git-filter-branch in various tests.
+# Nowadays it has a warning with associated sleep.
+export FILTER_BRANCH_SQUELCH_WARNING=1
+
root=`pwd`
troot=$root/tests
testname="${DGIT_TEST_TESTNAME-${0##*/}}"
@@ -161,6 +185,7 @@ t-expect-push-fail () {
t-reporefs pre-push
t-expect-fail "$mpat" "$@"
+ cp $tmp/t.output $tmp/t.push-output
t-reporefs post-push
diff $tmp/show-refs.{pre,post}-push
@@ -169,6 +194,23 @@ t-expect-push-fail () {
eval "$t_expect_push_fail_hook"
}
+t-expect-push-fail-retriably () {
+ t-expect-push-fail "$@"
+ grep 'You can retry the push, after fixing the problem, if you like' \
+ $tmp/t.push-output
+}
+
+t-expect-push-fail-tainted () {
+ # t-expect-push-fail-local-and-remote $m $push_args...
+ # Message is implicitly prefixed with 'E:^'
+ # to avoid spotting them in protocol debug output etc.
+ # Same message is expected from the remote.
+ local m="$1"; shift
+
+ t-expect-push-fail-retriably "E:^$m" "$@"
+ t-expect-push-fail "E:^remote: $m" "$@" --force-push-tainted
+}
+
t-git-objects-not-present () {
# t-git-objects-not-present GITDIR|'' OBJID [...]
# specifying '' means the repo for package $p
@@ -432,6 +474,8 @@ t-git-fsck () {
0) fail "unexpected messages from git-fsck" ;;
*) fail "grep of git-fsck failed" ;;
esac
+
+ t-output "" git log --all --grep '^\[dgit .*INTERNAL.*]'
}
t-check-only-bpd () {
@@ -463,8 +507,22 @@ t-save-artifacts () {
artifacts="$AUTOPKGTEST_ARTIFACTS"
if [ x"$artifacts" = x ]; then return; fi
if [ x"tmp" = x ]; then return; fi
+ # Empirically in a non-autopkgtest run with AUTOPKGTEST_ARTIFACTS
+ # this `-1` flag to gzip decreased the runtime from 585s (2558s CPU)
+ # to 609s (2730s CPU), a decrease of 5-7%. It increased the
+ # total size of the artifacts from 24220k to 26092k, ie +8%,
+ # but in a real autopkgtest run there are many bigger things
+ # alongside AUTOPKGTEST_ARTIFACTS put there by autopkgtest itself.
GZIP=-1v tar -C "$tmp" -zc -f "$artifacts/${0##*/}.tar.gz" \
--exclude=\*.tar .
+ local logfile="$DGIT_TEST_REDIRECTED_LOG"
+ if [ "$logfile" ]; then
+ unset DGIT_TEST_REDIRECTED_LOG
+ set +x
+ DGIT_TRAP_QUIET=1
+ exec >&5 2>&1
+ gzip -f -- "$logfile"
+ fi
}
t-rm-dput-dropping () {
@@ -600,6 +658,7 @@ t-setup-import () {
simport="$1"; shift
if [ -e "$simport" ]; then exit 0; fi
env - "$@" \
+ env -u DGIT_TEST_REDIRECTED_LOG \
"tests/setup/$setupname"
' x "$root" "$setupname" "$simport"
fi
@@ -909,7 +968,7 @@ t-commit-build-push-expect-log () {
t-commit "$msg"
t-dgit build
LC_MESSAGES=C \
- t-dgit push --new 2>&1 |tee $tmp/push.log
+ t-dgit push-built --new 2>&1 |tee $tmp/push.log
t-grep-mpat "$mpat" $tmp/push.log
}
@@ -1126,7 +1185,7 @@ t-merge-conflicted-stripping-conflict-markers () {
t-commit () {
local msg=$1
v=${2:-${majorv:-1}.$revision}
- $troot/tstunt/debchange \
+ t-debchange \
--force-distribution -v$v --distribution ${3:-unstable} "$1"
git add debian/changelog
debcommit
@@ -1144,10 +1203,14 @@ t-dch-commit-r () {
}
t-dch-commit () {
- $troot/tstunt/debchange "$@"
+ t-debchange "$@"
git commit -m "dch $*" debian/changelog
}
+t-debchange () {
+ DEBEMAIL=dgit-tests@example.org $troot/tstunt/debchange "$@"
+}
+
t-git-config () {
git config --global "$@"
}
@@ -1315,6 +1378,7 @@ t-alt-test () {
}
t-git-config dgit.default.old-dsc-distro test-dummy
+t-git-config dgit-distro.test-dummy.policy-query-supported-ssh true
for import in ${autoimport-gnupg}; do
case "$0" in
diff --git a/tests/lib-baredebian b/tests/lib-baredebian
index 557c051..51beb1f 100644
--- a/tests/lib-baredebian
+++ b/tests/lib-baredebian
@@ -68,7 +68,8 @@ baredebian-test-core-push () {
# (rather than dgit build), but so that we can check that our
# output is the same as users are used to.
- t-dgit -wn --quilt=$quiltmode --dgit-view-save=split.p --new push
+ t-dgit -wn --quilt=$quiltmode --dgit-view-save=split.p --new \
+ push-built
}
baredebian-test-core-postpush () {
diff --git a/tests/lib-core b/tests/lib-core
index 7fdddb4..d4d0bd5 100644
--- a/tests/lib-core
+++ b/tests/lib-core
@@ -33,6 +33,7 @@ t-set-using-tmp () {
git config --global user.email 'dgit-test@debian.example.net'
git config --global user.name "$DEBFULLNAME"
git config --global protocol.ext.allow always
+ git config --global dgit.default.push-subcmd reject
}
t-filter-out-git-hyphen-dir () {
diff --git a/tests/lib-orig-include-exclude b/tests/lib-orig-include-exclude
index 104cf0b..4372f36 100644
--- a/tests/lib-orig-include-exclude
+++ b/tests/lib-orig-include-exclude
@@ -29,7 +29,7 @@ test-push-1 () {
test-push-2 () {
$test_push_2_hook
- t-dgit $ch "$@" push
+ t-dgit $ch "$@" push-built
}
test-push-1 1.0-2 --ch:-sa
diff --git a/tests/pkg-srcs/example_1.0-1+absurd.debian.tar.xz b/tests/pkg-srcs/example_1.0-1+absurd.debian.tar.xz
index 9a2dd12..5f9ae71 100644
--- a/tests/pkg-srcs/example_1.0-1+absurd.debian.tar.xz
+++ b/tests/pkg-srcs/example_1.0-1+absurd.debian.tar.xz
Binary files differ
diff --git a/tests/pkg-srcs/example_1.0-1+absurd.dsc b/tests/pkg-srcs/example_1.0-1+absurd.dsc
index 1ab743d..cc7f80b 100644
--- a/tests/pkg-srcs/example_1.0-1+absurd.dsc
+++ b/tests/pkg-srcs/example_1.0-1+absurd.dsc
@@ -11,12 +11,12 @@ Package-List:
Checksums-Sha1:
2bc730f941db49de57e9678fb0b07bd95507bb44 236 example_1.0.orig-docs.tar.gz
4bff9170ce9b10cb59937195c5ae2c73719fe150 373 example_1.0.orig.tar.gz
- dafb6f0db0580179ff246dba1dc2892246e84a2c 1416 example_1.0-1+absurd.debian.tar.xz
+ 6ee4c2149fecb1924ffde88c034deefe6a4cee9d 1528 example_1.0-1+absurd.debian.tar.xz
Checksums-Sha256:
ad9671f6b25cdd9f0573f803f702448a45a45183db1d79701aa760bccbeed29c 236 example_1.0.orig-docs.tar.gz
a3ef7c951152f3ec754f96fd483457aa88ba06df3084e6f1cc7c25b669567c17 373 example_1.0.orig.tar.gz
- 4003c34398894e46823bb3fda69f4351dbd5649e321259cde266a135f0428c51 1416 example_1.0-1+absurd.debian.tar.xz
+ 79702097c21c31773f7fa3b5d0f4e535e6d6a66952075185b81915bfb27a62a8 1528 example_1.0-1+absurd.debian.tar.xz
Files:
cb0cb5487b1e5bcb82547396b4fe93e5 236 example_1.0.orig-docs.tar.gz
599f47808a7754c66aea3cda1b3208d6 373 example_1.0.orig.tar.gz
- 0e88c1ed094f09ee7bf57607132d55ee 1416 example_1.0-1+absurd.debian.tar.xz
+ ed26c7be15f59fafbacffb505365731a 1528 example_1.0-1+absurd.debian.tar.xz
diff --git a/tests/pkg-srcs/example_1.0-1+brokenmeta.debian.tar.xz b/tests/pkg-srcs/example_1.0-1+brokenmeta.debian.tar.xz
index caad820..504bbb6 100644
--- a/tests/pkg-srcs/example_1.0-1+brokenmeta.debian.tar.xz
+++ b/tests/pkg-srcs/example_1.0-1+brokenmeta.debian.tar.xz
Binary files differ
diff --git a/tests/pkg-srcs/example_1.0-1+brokenmeta.dsc b/tests/pkg-srcs/example_1.0-1+brokenmeta.dsc
index c7c363d..59d25ce 100644
--- a/tests/pkg-srcs/example_1.0-1+brokenmeta.dsc
+++ b/tests/pkg-srcs/example_1.0-1+brokenmeta.dsc
@@ -11,12 +11,12 @@ Package-List:
Checksums-Sha1:
2bc730f941db49de57e9678fb0b07bd95507bb44 236 example_1.0.orig-docs.tar.gz
4bff9170ce9b10cb59937195c5ae2c73719fe150 373 example_1.0.orig.tar.gz
- 68e0e1e3ec092409652d047e62bd3f0dba5a51f3 1304 example_1.0-1+brokenmeta.debian.tar.xz
+ 0b7117415e1b3c2e3a9084ef07872c95085ec0aa 1304 example_1.0-1+brokenmeta.debian.tar.xz
Checksums-Sha256:
ad9671f6b25cdd9f0573f803f702448a45a45183db1d79701aa760bccbeed29c 236 example_1.0.orig-docs.tar.gz
a3ef7c951152f3ec754f96fd483457aa88ba06df3084e6f1cc7c25b669567c17 373 example_1.0.orig.tar.gz
- 3ef0a50e3c0e025d0facada85d4508469c88150504c079698ae329c0c18bf315 1304 example_1.0-1+brokenmeta.debian.tar.xz
+ 9383ffabb2a169c252529f2dea098c55d0956fdadba34a8617bfbff47091ac7f 1304 example_1.0-1+brokenmeta.debian.tar.xz
Files:
cb0cb5487b1e5bcb82547396b4fe93e5 236 example_1.0.orig-docs.tar.gz
599f47808a7754c66aea3cda1b3208d6 373 example_1.0.orig.tar.gz
- 2ed3f4310bdda12b58b1b412d1c88dd9 1304 example_1.0-1+brokenmeta.debian.tar.xz
+ 48308be2bfae98f989e724fb3c52b397 1304 example_1.0-1+brokenmeta.debian.tar.xz
diff --git a/tests/pkg-srcs/example_1.0-1.100.debian.tar.xz b/tests/pkg-srcs/example_1.0-1.100.debian.tar.xz
index ea8ec34..e193d4d 100644
--- a/tests/pkg-srcs/example_1.0-1.100.debian.tar.xz
+++ b/tests/pkg-srcs/example_1.0-1.100.debian.tar.xz
Binary files differ
diff --git a/tests/pkg-srcs/example_1.0-1.100.dsc b/tests/pkg-srcs/example_1.0-1.100.dsc
index 5b075b5..8c7c417 100644
--- a/tests/pkg-srcs/example_1.0-1.100.dsc
+++ b/tests/pkg-srcs/example_1.0-1.100.dsc
@@ -11,12 +11,12 @@ Package-List:
Checksums-Sha1:
2bc730f941db49de57e9678fb0b07bd95507bb44 236 example_1.0.orig-docs.tar.gz
4bff9170ce9b10cb59937195c5ae2c73719fe150 373 example_1.0.orig.tar.gz
- 86c31eba5e08c1765f8e557b97e59d7e1fd9c208 2108 example_1.0-1.100.debian.tar.xz
+ 94dbd51291d7534a9e50a2cebfb1f484999e877b 2156 example_1.0-1.100.debian.tar.xz
Checksums-Sha256:
ad9671f6b25cdd9f0573f803f702448a45a45183db1d79701aa760bccbeed29c 236 example_1.0.orig-docs.tar.gz
a3ef7c951152f3ec754f96fd483457aa88ba06df3084e6f1cc7c25b669567c17 373 example_1.0.orig.tar.gz
- 163f1a753f0ea382148df8d9553240d503781badf03c600946f1400534da1349 2108 example_1.0-1.100.debian.tar.xz
+ 1d76c05cc52b1bc517defb336b7d1e8e59651fc19cd6e303b88be45558adca08 2156 example_1.0-1.100.debian.tar.xz
Files:
cb0cb5487b1e5bcb82547396b4fe93e5 236 example_1.0.orig-docs.tar.gz
599f47808a7754c66aea3cda1b3208d6 373 example_1.0.orig.tar.gz
- 4b7f5d286eff2608107c77c96584a01a 2108 example_1.0-1.100.debian.tar.xz
+ 7f30fd213f0e30613615b2c196c48635 2156 example_1.0-1.100.debian.tar.xz
diff --git a/tests/pkg-srcs/example_1.0-1.debian.tar.xz b/tests/pkg-srcs/example_1.0-1.debian.tar.xz
index 84ca563..4ff8b74 100644
--- a/tests/pkg-srcs/example_1.0-1.debian.tar.xz
+++ b/tests/pkg-srcs/example_1.0-1.debian.tar.xz
Binary files differ
diff --git a/tests/pkg-srcs/example_1.0-1.dsc b/tests/pkg-srcs/example_1.0-1.dsc
index bb65f6e..84f0f2e 100644
--- a/tests/pkg-srcs/example_1.0-1.dsc
+++ b/tests/pkg-srcs/example_1.0-1.dsc
@@ -11,12 +11,12 @@ Package-List:
Checksums-Sha1:
2bc730f941db49de57e9678fb0b07bd95507bb44 236 example_1.0.orig-docs.tar.gz
4bff9170ce9b10cb59937195c5ae2c73719fe150 373 example_1.0.orig.tar.gz
- f2398be1e588e10d11b20ee9bc5ca0eb16e4c158 1304 example_1.0-1.debian.tar.xz
+ 8d131c4fd924859e3462e48a33f669da15684992 1300 example_1.0-1.debian.tar.xz
Checksums-Sha256:
ad9671f6b25cdd9f0573f803f702448a45a45183db1d79701aa760bccbeed29c 236 example_1.0.orig-docs.tar.gz
a3ef7c951152f3ec754f96fd483457aa88ba06df3084e6f1cc7c25b669567c17 373 example_1.0.orig.tar.gz
- fd97c0fb879bfa8084f24a0d0f808a56beb533f17d92c808dc293ff297007925 1304 example_1.0-1.debian.tar.xz
+ 1bc840ae1b76b95ab375c962508a3b14f6958f9766e67c0ef06f5e7dd249d1c7 1300 example_1.0-1.debian.tar.xz
Files:
cb0cb5487b1e5bcb82547396b4fe93e5 236 example_1.0.orig-docs.tar.gz
599f47808a7754c66aea3cda1b3208d6 373 example_1.0.orig.tar.gz
- fd7840d249ee3dba5bdc3dcde7217bbe 1304 example_1.0-1.debian.tar.xz
+ 593103737fe55b5fafcdc0eda5e7f761 1300 example_1.0-1.debian.tar.xz
diff --git a/tests/pkg-srcs/pari-extra_3-1.diff.gz b/tests/pkg-srcs/pari-extra_3-1.diff.gz
index 81f7f2e..3c3d568 100644
--- a/tests/pkg-srcs/pari-extra_3-1.diff.gz
+++ b/tests/pkg-srcs/pari-extra_3-1.diff.gz
Binary files differ
diff --git a/tests/pkg-srcs/pari-extra_3-1.dsc b/tests/pkg-srcs/pari-extra_3-1.dsc
index 8d67ed0..110dbb6 100644
--- a/tests/pkg-srcs/pari-extra_3-1.dsc
+++ b/tests/pkg-srcs/pari-extra_3-1.dsc
@@ -1,6 +1,3 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
Format: 1.0
Source: pari-extra
Binary: pari-extra
@@ -9,22 +6,14 @@ Version: 3-1
Maintainer: Bill Allombert <ballombe@debian.org>
Standards-Version: 3.9.2.0
Build-Depends: debhelper (>= 5)
-Package-List:
- pari-extra deb math optional
-Checksums-Sha1:
+Package-List:
+ pari-extra deb math optional arch=all
+Checksums-Sha1:
ff281e103ab11681324b0c694dd3514d78436c51 121 pari-extra_3.orig.tar.gz
- 080078dbc51e4194d209cb5abe57e2b25705fcaa 2358 pari-extra_3-1.diff.gz
-Checksums-Sha256:
+ ca13e48c1b8e063bd33a8c897c44b2fa54c7b607 2357 pari-extra_3-1.diff.gz
+Checksums-Sha256:
ac1ef39f9da80b582d1c0b2adfb09b041e3860ed20ddcf57a0e922e3305239df 121 pari-extra_3.orig.tar.gz
- bf4672acd5302b9eebee2f3bf5269022279e531204d7172b8761bb10fae3517a 2358 pari-extra_3-1.diff.gz
-Files:
+ 90b5f4bdda25d1bf39530cc14310f51d88c8696eef2589f4a7f5991596fe7b1d 2357 pari-extra_3-1.diff.gz
+Files:
76bcf03be979d3331f9051aa88439b8b 121 pari-extra_3.orig.tar.gz
- 02a39965adb84da9b3e6b5c5a0a4c378 2358 pari-extra_3-1.diff.gz
-
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.10 (GNU/Linux)
-
-iEYEARECAAYFAk5CvdoACgkQeDPs8bVESBX0mACeK3Yf9y22T2b6tw8eVQ8XSYxH
-ix4AoJJ3jrGJ4HXJNv/wbvmvBkkybvYJ
-=hkic
------END PGP SIGNATURE-----
+ 264a508299ea6d57c6a386e26d9d6f49 2357 pari-extra_3-1.diff.gz
diff --git a/tests/pkg-srcs/pari-extra_3-2~dummy1.diff.gz b/tests/pkg-srcs/pari-extra_3-2~dummy1.diff.gz
index f5dff2b..a793172 100644
--- a/tests/pkg-srcs/pari-extra_3-2~dummy1.diff.gz
+++ b/tests/pkg-srcs/pari-extra_3-2~dummy1.diff.gz
Binary files differ
diff --git a/tests/pkg-srcs/pari-extra_3-2~dummy1.dsc b/tests/pkg-srcs/pari-extra_3-2~dummy1.dsc
index 1042f09..a55a751 100644
--- a/tests/pkg-srcs/pari-extra_3-2~dummy1.dsc
+++ b/tests/pkg-srcs/pari-extra_3-2~dummy1.dsc
@@ -6,14 +6,14 @@ Version: 3-2~dummy1
Maintainer: Bill Allombert <ballombe@debian.org>
Standards-Version: 3.9.2.0
Build-Depends: debhelper (>= 5), package-does-not-exist
-Package-List:
- pari-extra deb math optional
-Checksums-Sha1:
+Package-List:
+ pari-extra deb math optional arch=all
+Checksums-Sha1:
ff281e103ab11681324b0c694dd3514d78436c51 121 pari-extra_3.orig.tar.gz
- 810c43d186ad2552d65949acf4a065fcfc823636 2484 pari-extra_3-2~dummy1.diff.gz
-Checksums-Sha256:
+ 335afa3b9e4b671a67d00e699be080df44fe08fa 2486 pari-extra_3-2~dummy1.diff.gz
+Checksums-Sha256:
ac1ef39f9da80b582d1c0b2adfb09b041e3860ed20ddcf57a0e922e3305239df 121 pari-extra_3.orig.tar.gz
- 41f47f24df7f50555f43549bd8377cce046750d29f69903e04b7fbfe396a0a73 2484 pari-extra_3-2~dummy1.diff.gz
-Files:
+ 2365210b7a21a28659747188464ae1b5869accc714212f6d5d0c6632899c2ca0 2486 pari-extra_3-2~dummy1.diff.gz
+Files:
76bcf03be979d3331f9051aa88439b8b 121 pari-extra_3.orig.tar.gz
- eff09e2ace409a150646c4994f17f800 2484 pari-extra_3-2~dummy1.diff.gz
+ 5a4ffde2059a1c4c7280bf63ca99991d 2486 pari-extra_3-2~dummy1.diff.gz
diff --git a/tests/pkg-srcs/ruby-rails-3.2_3.2.6-1.debian.tar.gz b/tests/pkg-srcs/ruby-rails-3.2_3.2.6-1.debian.tar.gz
deleted file mode 100644
index 633e6db..0000000
--- a/tests/pkg-srcs/ruby-rails-3.2_3.2.6-1.debian.tar.gz
+++ /dev/null
Binary files differ
diff --git a/tests/pkg-srcs/ruby-rails-3.2_3.2.6-1.debian.tar.xz b/tests/pkg-srcs/ruby-rails-3.2_3.2.6-1.debian.tar.xz
new file mode 100644
index 0000000..30a8787
--- /dev/null
+++ b/tests/pkg-srcs/ruby-rails-3.2_3.2.6-1.debian.tar.xz
Binary files differ
diff --git a/tests/pkg-srcs/ruby-rails-3.2_3.2.6-1.dsc b/tests/pkg-srcs/ruby-rails-3.2_3.2.6-1.dsc
index 4f2e290..f840718 100644
--- a/tests/pkg-srcs/ruby-rails-3.2_3.2.6-1.dsc
+++ b/tests/pkg-srcs/ruby-rails-3.2_3.2.6-1.dsc
@@ -1,6 +1,3 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
Format: 3.0 (quilt)
Source: ruby-rails-3.2
Binary: ruby-rails-3.2, rails3
@@ -8,30 +5,21 @@ Architecture: all
Version: 3.2.6-1
Maintainer: Debian Ruby Extras Maintainers <pkg-ruby-extras-maintainers@lists.alioth.debian.org>
Uploaders: Antonio Terceiro <terceiro@debian.org>
-Dm-Upload-Allowed: yes
Homepage: http://www.rubyonrails.org
Standards-Version: 3.9.3
Vcs-Browser: http://git.debian.org/?p=pkg-ruby-extras/ruby-rails.git;a=summary
Vcs-Git: git://git.debian.org/pkg-ruby-extras/ruby-rails-3.2.git
Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.3.0~)
-Package-List:
- rails3 deb ruby optional
- ruby-rails-3.2 deb ruby optional
-Checksums-Sha1:
+Package-List:
+ rails3 deb ruby optional arch=all
+ ruby-rails-3.2 deb ruby optional arch=all
+Checksums-Sha1:
f36c3866b22de8ff6875fdbbfbcfb8d18e1f5a89 953 ruby-rails-3.2_3.2.6.orig.tar.gz
- 7208250afe7083e258d1fa36cc3a60527608df11 2297 ruby-rails-3.2_3.2.6-1.debian.tar.gz
-Checksums-Sha256:
+ 5a6ca14c46eb4b9297f024675d43002751d560e7 2252 ruby-rails-3.2_3.2.6-1.debian.tar.xz
+Checksums-Sha256:
207cfb1ef70aa9458c776deeda8e38ac977cbc852209828793b27d55bebc7bea 953 ruby-rails-3.2_3.2.6.orig.tar.gz
- 55decdcdc8248a4153fb7e5688ffdc3c3a2661a95f3870edba3e1eaf40907088 2297 ruby-rails-3.2_3.2.6-1.debian.tar.gz
-Files:
+ ab65b0fe41fff9abb87b538b5d526c2b47af27f784cf4cf2e8c01e399cde7b00 2252 ruby-rails-3.2_3.2.6-1.debian.tar.xz
+Files:
05a3954762c2a2101a10dd2efddf7000 953 ruby-rails-3.2_3.2.6.orig.tar.gz
- 87bdb28ef5053d825bda80e959e2fd1c 2297 ruby-rails-3.2_3.2.6-1.debian.tar.gz
+ e1c519bb58a39d01f4dc6828985057fe 2252 ruby-rails-3.2_3.2.6-1.debian.tar.xz
Ruby-Versions: all
-
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.12 (GNU/Linux)
-
-iEYEARECAAYFAk/nrgIACgkQDOM8kQ+cso9TjgCfcDl8MvUtKVZP6bPP9IrO93hP
-TnAAn1aA67N088u6u/S2VA8UhYjNXhpO
-=7sbS
------END PGP SIGNATURE-----
diff --git a/tests/pkg-srcs/sunxi-tools_1.2-2.~~dgittest.debian.tar.gz b/tests/pkg-srcs/sunxi-tools_1.2-2.~~dgittest.debian.tar.gz
deleted file mode 100644
index c376961..0000000
--- a/tests/pkg-srcs/sunxi-tools_1.2-2.~~dgittest.debian.tar.gz
+++ /dev/null
Binary files differ
diff --git a/tests/pkg-srcs/sunxi-tools_1.2-2.~~dgittest.debian.tar.xz b/tests/pkg-srcs/sunxi-tools_1.2-2.~~dgittest.debian.tar.xz
new file mode 100644
index 0000000..8ac2131
--- /dev/null
+++ b/tests/pkg-srcs/sunxi-tools_1.2-2.~~dgittest.debian.tar.xz
Binary files differ
diff --git a/tests/pkg-srcs/sunxi-tools_1.2-2.~~dgittest.dsc b/tests/pkg-srcs/sunxi-tools_1.2-2.~~dgittest.dsc
index e0161cd..820022d 100644
--- a/tests/pkg-srcs/sunxi-tools_1.2-2.~~dgittest.dsc
+++ b/tests/pkg-srcs/sunxi-tools_1.2-2.~~dgittest.dsc
@@ -9,14 +9,14 @@ Standards-Version: 3.9.5
Vcs-Browser: http://git.debian.org/?p=collab-maint/sunxi-tools.git
Vcs-Git: git://git.debian.org/collab-maint/sunxi-tools.git
Build-Depends: debhelper (>= 9), pkg-config, libusb-1.0-0-dev, u-boot-tools
-Package-List:
- sunxi-tools deb utils optional
-Checksums-Sha1:
+Package-List:
+ sunxi-tools deb utils optional arch=any
+Checksums-Sha1:
2457216dbbf5552c413753f7211f7be3db6aff54 35076 sunxi-tools_1.2.orig.tar.gz
- 6f30698cd897b350a4f92b2b5dded69adca6f82e 5182 sunxi-tools_1.2-2.~~dgittest.debian.tar.gz
-Checksums-Sha256:
+ 491322a7e377365cf53104b5dda6a30ede0c01f7 4892 sunxi-tools_1.2-2.~~dgittest.debian.tar.xz
+Checksums-Sha256:
03a63203ff79389e728d88ad705e546aa6362a6d08b9901392acb8639998ef95 35076 sunxi-tools_1.2.orig.tar.gz
- 0a513f3254d245b59aaffbeb5c43159a6461617c1f6f3c6824646c4259cda406 5182 sunxi-tools_1.2-2.~~dgittest.debian.tar.gz
-Files:
+ 33b627e8958f1bc6d2a9bf1d1a042ac808924d860c09272989067fd57b9fb8e6 4892 sunxi-tools_1.2-2.~~dgittest.debian.tar.xz
+Files:
dbc55f60559f9db497559176c3c753dd 35076 sunxi-tools_1.2.orig.tar.gz
- a6ec0eb0d897b0121dc978fc00db2ea6 5182 sunxi-tools_1.2-2.~~dgittest.debian.tar.gz
+ 528d6bb421ba55aa1cec176298f8f14c 4892 sunxi-tools_1.2-2.~~dgittest.debian.tar.xz
diff --git a/tests/run-all b/tests/run-all
index 736e0fe..f827059 100755
--- a/tests/run-all
+++ b/tests/run-all
@@ -18,7 +18,7 @@ while [ $# != 0 ]; do
done
ncpus=$(nproc || echo 1)
-jcpus=-j$(( ncpus * 134 / 100 ))
+jcpus=-j$(( ncpus * 167 / 100 ))
if [ "x$DGIT_TESTS_TMPDIR" != x ]; then
tmpdir="$PWD"
diff --git a/tests/setup/examplegit b/tests/setup/examplegit
index d25ee95..2d4ce4f 100755
--- a/tests/setup/examplegit
+++ b/tests/setup/examplegit
@@ -16,7 +16,7 @@ push-to () {
t-refs-same-start
t-ref-head
t-dgit build
- t-dgit push --new $2
+ t-dgit push-built --new $2
t-pushed-good $1 $2
t-archive-process-incoming $2
}
diff --git a/tests/tests/badcommit-rewrite b/tests/tests/badcommit-rewrite
deleted file mode 100755
index 3e2f37e..0000000
--- a/tests/tests/badcommit-rewrite
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/bash
-set -e
-. tests/lib
-
-t-setup-import examplegit
-t-tstunt-parsechangelog
-
-cd $tmp/git/$p.git
-git config core.sharedRepository true
-chmod -R g+w objects
-umask 022
-
-cd $tmp/example
-
-suite=stable
-
-t-commit 'No changes, just send to stable' '' stable
-
-t-make-badcommit
-git reset --hard $badcommit
-
-t-dgit -wgf build
-t-dgit push --overwrite=1.2 stable
-t-archive-process-incoming stable
-
-rstable=refs/remotes/dgit/dgit/stable
-
-t-dgit fetch stable
-t-has-parent-or-is $rstable $badcommit
-
-fixup=${DGIT_BADCOMMIT_FIXUP-dgit-badcommit-fixup}
-
-cd $tmp/git/$p.git
-git gc --aggressive --prune=all
-rmdir objects/* ||:
-
-$fixup --real
-
-cd $tmp/$p
-git symbolic-ref HEAD >../sym.before
-git rev-parse HEAD >../ref.before
-
-$fixup --real
-
-git symbolic-ref HEAD >../sym.after
-git rev-parse HEAD >../ref.after
-diff ../sym.before ../sym.after
-set +e; diff ../ref.before ../ref.after; rc=$?; set -e; test $rc = 1
-
-t-dgit fetch stable
-
-t-expect-fail "child $rstable lacks parent $badcommit" \
-t-has-parent-or-is $rstable $badcommit
-
-check_shared () {
- find "$1" -perm -200 \! -perm -020 -ls |tee $tmp/badperm
- test -f $tmp/badperm -a ! -s $tmp/badperm
-}
-
-check_shared $tmp/git/$p.git/objects
-
-t-ok
diff --git a/tests/tests/clone-nogit b/tests/tests/clone-nogit
index f36a7b6..9dceafc 100755
--- a/tests/tests/clone-nogit
+++ b/tests/tests/clone-nogit
@@ -19,8 +19,7 @@ debcommit -a
t-refs-same-start
t-ref-head
-t-dgit --dpkg-buildpackage:-d build
-t-dgit push
+t-dgit push-source
t-pushed-good dgit/sid
diff --git a/tests/tests/debpolicy-dbretry b/tests/tests/debpolicy-dbretry
index a9f2334..421dee2 100755
--- a/tests/tests/debpolicy-dbretry
+++ b/tests/tests/debpolicy-dbretry
@@ -20,7 +20,7 @@ git reset --hard HEAD~
t-commit 'Make something to autotaint'
t-dgit build
-t-dgit push --new
+t-dgit push-built --new
autotaint=`t-git-get-ref "refs/tags/$tagpfx/$v"`
@@ -55,7 +55,7 @@ DGIT_RPD_TEST_DBLOOP_HOOK='
'\'' and die "$? $!";
}
' \
-t-dgit push --deliberately-not-fast-forward
+t-dgit push-built --deliberately-not-fast-forward
exec 3>&-
wait $sqlite3_pid
diff --git a/tests/tests/debpolicy-newreject b/tests/tests/debpolicy-newreject
index af02ac1..bc084ae 100755
--- a/tests/tests/debpolicy-newreject
+++ b/tests/tests/debpolicy-newreject
@@ -12,6 +12,8 @@ revision=1
git tag start
t-dgit setup-mergechangelogs
+git config dgit.default.push-subcmd built
+
echo FORBIDDEN >debian/some-file
git add debian/some-file
t-commit 'Commit a forbidden thing'
@@ -25,7 +27,8 @@ t-git-objects-not-present "" $bad
'
t-dgit build
-t-expect-push-fail 'forbidden for testing' \
+t-expect-push-fail-tainted \
+ 'Reason: forbidden for testing' \
t-dgit push --new
t-git-dir-check enoent
@@ -51,7 +54,8 @@ t-git-dir-check enoent
t-commit 'should require --deliberately...questionable'
t-dgit build
-t-expect-push-fail E:"tag $tagpfx/${vanished//./\\.} referred to this object.*all previously pushed versions were found to have been removed" \
+t-expect-push-fail-tainted \
+ "Reason: tag $tagpfx/${vanished//./\\.} referred to this object.*all previously pushed versions were found to have been removed" \
t-dgit push --new
t-git-dir-check enoent
@@ -75,23 +79,27 @@ git reset --hard start
t-commit 'should require --deliberately..not-ff'
t-dgit build
-t-expect-push-fail "HEAD is not a descendant of the archive's version" \
+# Rewound, without passing the option
+t-expect-push-fail-retriably \
+ E:"^dgit: error: .* HEAD is not a descendant of the archive's version" \
t-dgit push
+# Rewound, passing stunt option to defeat local checks
+# so we check that remote check is effective.
t-expect-push-fail \
- "Package is in NEW and has not been accepted or rejected yet" \
+ E:"^remote: Package is in NEW and has not been accepted or rejected yet" \
t-dgit --deliberately-TEST-dgit-only-not-fast-forward push
t-dgit --deliberately-not-fast-forward --force-reusing-version push
cd $dgitrepo
-t-expect-push-fail "Not a valid object name" \
+t-expect-fail "Not a valid object name" \
git cat-file -p $oldobj
cd $tmp/$p
t-commit 'Still not accepted, will override taint'
t-dgit build
-t-expect-push-fail \
+t-expect-push-fail-tainted \
"Package is in NEW and has not been accepted or rejected yet" \
t-dgit push
@@ -107,17 +115,30 @@ t-dgit push
git checkout -b stoats $tagpfx/$vanished
t-commit 'Simulate accidentally building on rejected version'
t-dgit build
-t-expect-push-fail "HEAD is not a descendant of the archive's version" \
+t-expect-push-fail \
+ E:"^dgit: error:.* HEAD is not a descendant of the archive's version" \
t-dgit push
: "check that uploader can't force it now"
-t-expect-push-fail "not fast forward on dgit branch" \
-t-dgit --deliberately-not-fast-forward push
+t-expect-push-fail \
+ E:"^remote: .*: reject: not fast forward on dgit branch" \
+t-dgit --deliberately-not-fast-forward push \
+ --deliberately-include-questionable-history \
+ --force-push-tainted
+# Ideally ^ this would be detected locally first, in which case we would
+# use t-expect-push-fail-tainted or something like it. But it isn't.
t-dgit pull
t-dgit build
-t-expect-push-fail \
+t-expect-push-fail-tainted \
'Reason: rewound suite sid; --deliberately-not-fast-forward specified' \
t-dgit --force-reusing-version push
+: "override the previous taint check"
+t-dgit --force-reusing-version push-source \
+ --deliberately-include-questionable-history
+
+t-commit 'Check taint is truly gone'
+t-dgit push-source
+
t-ok
diff --git a/tests/tests/debpolicy-taintrm b/tests/tests/debpolicy-taintrm
index a9e54da..eccc290 100755
--- a/tests/tests/debpolicy-taintrm
+++ b/tests/tests/debpolicy-taintrm
@@ -17,6 +17,12 @@ t-dgit setup-mergechangelogs
t-dgit push-source --new
+t-commit 'edit after first push'
+
+t-expect-push-fail-tainted \
+ 'Package is in NEW and has not been accepted or rejected yet' \
+t-dgit push-source --new
+
: cut
rm $tmp/incoming/*
@@ -31,10 +37,15 @@ t-commit 'edit after cut'
: push, needs --deliberately
-t-expect-push-fail \
- 'all previously pushed versions were found to have been removed from NEW' \
+t-expect-push-fail-tainted \
+ 'Reason:.* all previously pushed versions were found to have been removed from NEW' \
t-dgit push-source --new
+t-expect-push-fail-tainted \
+ 'Reason:.* all previously pushed versions were found to have been removed from NEW' \
+t-dgit push-source --new --deliberately-not-fast-forward \
+ --force-reusing-version
+
t-dgit push-source --new --deliberately-include-questionable-history \
--force-reusing-version
diff --git a/tests/tests/distropatches-reject b/tests/tests/distropatches-reject
index 75f43db..58c62ce 100755
--- a/tests/tests/distropatches-reject
+++ b/tests/tests/distropatches-reject
@@ -9,7 +9,7 @@ cp $troot/pkg-srcs/${p}_3.2.6.orig.tar.gz .
t-worktree test
cd $p
-t-dgit --quilt=smash -wgf quilt-fixup
+t-dgit --quilt=try-linear -wgf quilt-fixup
build () {
t-dgit -wg --dpkg-buildpackage:-d build
@@ -64,9 +64,9 @@ build
DEB_VENDOR=test-dummy-aside \
expect-fail-distro-series DEB_VENDOR \
-t-dgit push
+t-dgit push-built
-t-dgit push
+t-dgit push-built
cd ..
perl -i~ -pe 's/^Dgit:.*\n//' incoming/${p}_${v}.dsc
diff --git a/tests/tests/dpkgsourceignores-correct b/tests/tests/dpkgsourceignores-correct
index 33de95e..f3d70fa 100755
--- a/tests/tests/dpkgsourceignores-correct
+++ b/tests/tests/dpkgsourceignores-correct
@@ -48,6 +48,6 @@ git add .
git commit -m 'want these'
t-dgit --quilt=smash -wgf build-source
-t-dgit -wgf push
+t-dgit --force-uploading-old-version -wgf push-built
t-ok
diff --git a/tests/tests/drs-push-masterupdate b/tests/tests/drs-push-masterupdate
index 8457b59..7135467 100755
--- a/tests/tests/drs-push-masterupdate
+++ b/tests/tests/drs-push-masterupdate
@@ -13,7 +13,7 @@ git tag common-ancestor
revision=1
t-dgit build
-t-dgit push --new
+t-dgit push-built --new
push_and_check () {
git push $dgitrepo $1
@@ -24,7 +24,7 @@ push_and_check () {
git checkout master
t-commit 'Empty update'
t-dgit build
- t-dgit push --new
+ t-dgit push-built --new
t-pushed-good master
}
diff --git a/tests/tests/drs-push-rejects b/tests/tests/drs-push-rejects
index f102d95..72db5a9 100755
--- a/tests/tests/drs-push-rejects
+++ b/tests/tests/drs-push-rejects
@@ -76,7 +76,7 @@ for h in object type tag; do
rc=$?
set -e
- if [ $rc = 128 ] && grep 'fatal: corrupt tag' badtag.err; then
+ if [ $rc = 128 ] && egrep 'fatal: corrupt tag|error: object fails fsck: missing.*Entry: invalid format' badtag.err; then
continue
elif [ $rc != 0 ]; then
cat badtag.err
@@ -144,11 +144,23 @@ mktag
mustfail 'tag name in tag is wrong' \
refs/tags/$tagpfx/wombat:refs/tags/$tagpfx/$version $push_spec1
-t-make-badcommit
-git checkout -b broken $badcommit
-prep unstable sid
-mktag
-mustfail "corrupted object $badcommit" $push_spec
+set +e
+badcommit=$(
+ set -e
+ LC_MESSAGES=C t-make-badcommit 2>badcommit.err
+ echo "$badcommit"
+)
+rc=$?
+set -e
+if [ $rc = 0 ]; then
+ git checkout -b broken $badcommit
+ prep unstable sid
+ mktag
+ mustfail "corrupted object $badcommit" $push_spec
+elif [ $rc = 128 ] && egrep 'error: object fails fsck: missingCommitter: invalid format' badcommit.err; then :; else
+ cat badcommit.err
+ fail "could not bad commit"
+fi
git checkout dgit/sid
prep unstable sid
diff --git a/tests/tests/gbp-orig b/tests/tests/gbp-orig
index c843663..15516c5 100755
--- a/tests/tests/gbp-orig
+++ b/tests/tests/gbp-orig
@@ -10,6 +10,8 @@ t-tstunt-parsechangelog
t-tstunt-debuild
t-tstunt-lintian
+git config --global diff.noprefix true
+
: '----- let gbp build a .orig for comparison -----'
gbp buildpackage --git-no-sign-tags -us -uc
@@ -24,7 +26,7 @@ t-dgit -wgf --dgit-view-save=split.b gbp-build --git-ignore-branch
t-dgit -wgf --quilt=gbp clean # gbp leaves dirty trees :-/
-t-dgit -wgf --dgit-view-save=split.p --quilt=gbp push --new
+t-dgit -wgf --dgit-view-save=split.p --quilt=gbp push-built --new
t-gbp-pushed-good
diff --git a/tests/tests/gdr-edits b/tests/tests/gdr-edits
index a8b519c..c37e9c9 100755
--- a/tests/tests/gdr-edits
+++ b/tests/tests/gdr-edits
@@ -7,6 +7,8 @@ t-dependencies GDR
t-tstunt-parsechangelog
t-setup-import gdr-convert-gbp
+git config --global init.defaultBranch trunk
+
cd $p
v=2.0-3
diff --git a/tests/tests/gdr-fresh b/tests/tests/gdr-fresh
index 169181c..642aacc 100755
--- a/tests/tests/gdr-fresh
+++ b/tests/tests/gdr-fresh
@@ -25,21 +25,22 @@ git commit -m 'initial debianisation'
t-make-orig example 1.0
-dgit-quilt-fixup-uses-gdr () {
+dgit-quilt-fixup-uses-dgit-linear () {
t-git-next-date
DGIT_TEST_DEBUG=-DD t-dgit quilt-fixup 2>&1 |tee ../fixup.out
- grep '^branch_is_gdr .* YES$' ../fixup.out
+ grep '^branch_is_gdr .* unmarked BreakwaterStart NO$' ../fixup.out
+
+ t-dgit --quilt=nofix quilt-fixup
}
-dgit-quilt-fixup-uses-gdr
+dgit-quilt-fixup-uses-dgit-linear
git checkout --detach patch-queue/quilt-tip
git rebase master
git push . HEAD:master
git checkout master
-dgit-quilt-fixup-uses-gdr
-t-gdr-made-patches
+dgit-quilt-fixup-uses-dgit-linear
t-ok
diff --git a/tests/tests/gdr-import-dgitview b/tests/tests/gdr-import-dgitview
index 18d06f5..f761b02 100755
--- a/tests/tests/gdr-import-dgitview
+++ b/tests/tests/gdr-import-dgitview
@@ -25,20 +25,26 @@ grep 'bare dgit dsc import with no prior history' ../bare-output
git branch before
t-expect-fail E:'Could not find or construct a suitable upstream commit' \
-t-git-debrebase convert-from-dgit-view --no-origs
+t-git-debrebase convert-from-dgit-view $GDR_DIAGNOSE --no-origs
-t-git-debrebase convert-from-dgit-view
+t-git-debrebase convert-from-dgit-view $GDR_DIAGNOSE
t-gdr-good laundered
t-expect-fail E:'already seems to be in git-debrebase format' \
-t-git-debrebase convert-from-dgit-view
+t-git-debrebase convert-from-dgit-view $GDR_DIAGNOSE
t-refs-same-start
t-ref-head
-t-git-debrebase --noop-ok convert-from-dgit-view
+t-git-debrebase --noop-ok convert-from-dgit-view $GDR_DIAGNOSE
t-ref-head
-t-git-debrebase -falready-converted convert-from-dgit-view \
+t-expect-fail E:'Output of conversion does not match input' \
+t-git-debrebase -falready-converted convert-from-dgit-view $GDR_DIAGNOSE \
+ --always-convert-anyway
+
+t-git-debrebase make-patches
+
+t-git-debrebase -falready-converted convert-from-dgit-view $GDR_DIAGNOSE \
--always-convert-anyway
t-expect-fail E:'ref varies' t-ref-head
t-gdr-good laundered
diff --git a/tests/tests/gdr-import-nostitch b/tests/tests/gdr-import-nostitch
index c32b71e..3833c2e 100755
--- a/tests/tests/gdr-import-nostitch
+++ b/tests/tests/gdr-import-nostitch
@@ -25,6 +25,6 @@ t-git-debrebase -fupstream-has-debian -funused-patches -fseries-comments \
convert-from-gbp \
2>&1 | tee ../convert-msg
-grep -e 'dgit --overwrite will be needed' ../convert-msg >/dev/null
+grep -e 'dgit --trust-changelog will be needed' ../convert-msg >/dev/null
t-ok
diff --git a/tests/tests/gdr-merge-conflicts b/tests/tests/gdr-merge-conflicts
index 5a3f243..05b5480 100755
--- a/tests/tests/gdr-merge-conflicts
+++ b/tests/tests/gdr-merge-conflicts
@@ -63,8 +63,8 @@ git merge --no-edit -s ours other
# we have to do a little dance to make this not a pseudomerge
t-git-next-date
-dch -a 'Merge, only conflict was in debian/changelog'
-t-dch-r-rune dch
+t-debchange -a 'Merge, only conflict was in debian/changelog'
+t-dch-r-rune t-debchange
git commit -a --amend --no-edit
wreckage-before
diff --git a/tests/tests/gitworktree b/tests/tests/gitworktree
index e675a0a..e8963b7 100755
--- a/tests/tests/gitworktree
+++ b/tests/tests/gitworktree
@@ -22,8 +22,6 @@ git add modification
git commit -m 'want this'
t-dgit -wgf quilt-fixup
-t-dgit -wgf --quilt=nofix build
-
-t-dgit -wgf push
+t-dgit -wgf --quilt=nofix push-source --force-uploading-old-version
t-ok
diff --git a/tests/tests/i18n-messages b/tests/tests/i18n-messages
index f2aaa87..babcff1 100755
--- a/tests/tests/i18n-messages
+++ b/tests/tests/i18n-messages
@@ -3,7 +3,7 @@ set -e
autoimport=
. tests/lib
-t-dependencies NO-DGIT GDR
+t-dependencies NO-DGIT GDR locales-all
t-restrict x-dgit-out-of-tree-only
# We don't run this test in-tree because:
# 1. The .mo files that we would use might need to be built
@@ -31,6 +31,7 @@ git checkout master
anchor=$(t-git-debrebase anchor)
+expect_fail_lcmessages=C.UTF-8
t-expect-fail F:'old anchor is recognised' \
t-git-debrebase --anchor=$anchor new-upstream 2.1
diff --git a/tests/tests/import-linkorigs b/tests/tests/import-linkorigs
index 815f960..ff0d816 100755
--- a/tests/tests/import-linkorigs
+++ b/tests/tests/import-linkorigs
@@ -3,6 +3,8 @@ set -e
. tests/lib
. $troot/lib-import-chk
+t-dependencies xz-utils
+
t-tstunt-parsechangelog
t-archive-none example
@@ -58,3 +60,17 @@ for bpdhow in none rel abs; do
cd ../..
done
done
+
+rm -rf dupes
+cp -a rel-rel dupes
+cd dupes
+orig=${p}_${v%-*}.orig.tar
+zcat bpd/$orig.gz | xz -1 >$orig.xz
+cd $p
+
+ls -al ../bpd
+
+t-expect-fail 'Duplicate/inconsistent orig tarballs' \
+t-dgit build-source
+
+t-ok
diff --git a/tests/tests/import-pushold b/tests/tests/import-pushold
new file mode 100755
index 0000000..ed73fa3
--- /dev/null
+++ b/tests/tests/import-pushold
@@ -0,0 +1,37 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+t-tstunt-parsechangelog
+
+p=example
+old=1.0-1
+current=1.0-1.100
+
+t-archive $p $current
+t-git-none
+
+mkdir $p
+cd $p
+git init
+t-dgit import-dsc $troot/pkg-srcs/${p}_${old}.dsc main
+git checkout main
+
+t-dgit fetch
+
+: "attempt push of old"
+
+t-expect-fail 'trying to push an old version' \
+t-dgit push-source --deliberately-not-fast-forward --overwrite
+
+: "attempt push of current"
+
+t-dgit checkout sid
+
+t-expect-fail 'trying to push an old version' \
+t-dgit push-source --deliberately-not-fast-forward --overwrite
+
+t-dgit push-source --force-uploading-old-version
+t-pushed-good dgit/sid
+
+t-ok
diff --git a/tests/tests/import-r1clog b/tests/tests/import-r1clog
new file mode 100755
index 0000000..80044aa
--- /dev/null
+++ b/tests/tests/import-r1clog
@@ -0,0 +1,94 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+p=sunxi-tools
+v_upstr=1.2
+v_base=$v_upstr-2
+v_input=$v_base.~~dgittest
+
+dpkg-source -x $troot/pkg-srcs/${p}_${v_input}.dsc unmang
+
+mkdir $p
+cd $p
+git init
+cd ..
+
+perl-i-clog () {
+ perl -i "$@" debian/changelog
+}
+
+mangle-start () {
+ mang=$1
+ v="$v_base.$mang"
+ cp -al unmang $mang
+ cd $mang
+ perl-i-clog -pe 's{\~\~dgittest}{'$mang'} if $.==1'
+ cat >>debian/changelog <<'END'
+
+sunxi-tools (1.0-1) unstable; urgency=medium
+
+ * Lies for dgit testing
+
+ -- Example <example@example.org> Sat, 12 Jul 2011 20:51:56 +0100
+END
+}
+mangle-import () {
+ rm -f debian/*~
+ dpkg-source -b .
+ cd ../$p
+ t-dgit import-dsc ../${p}_${v}.dsc $mang
+ git checkout $mang
+}
+mangle-done () {
+ cd ..
+}
+
+mangle-start good
+mangle-import
+
+: ---------- 'check that if all is well we make right author line' ----------
+
+perl -ne <debian/changelog '
+ next unless m{^'$p' \('$v_upstr'-1\) }...m{^\S};
+ next unless m{^ -- (.*) (.*) ([-+]\d+)};
+ $time_t = `date -d "$2 $3" +%s`;
+ chomp $time_t;
+ $authline = "$1 $time_t $3";
+ print "author $authline\n";
+ print "committer $authline\n";
+ exit 0;
+' >../headlines-exp
+ch=$(git log -P --grep '^\[dgit import orig ' --pretty='format:%H')
+git cat-file commit $ch |
+perl -ne 'next if m/^$/..0; print if m/^(?:author|committer) /' \
+ >../headlines-got-orig
+diff ../headlines-exp ../headlines-got-orig
+
+mangle-done
+
+: ---------- 'test missing finalisation data in -1' ----------
+
+mangle-start missingdate
+perl-i-clog -pe '$_="" if m{^ -- .* Sat, 12 Jul 2014 20:51:56}'
+mangle-import
+mangle-done
+
+: ---------- 'test garbage before -1' ----------
+
+mangle-start garbage
+perl-i-clog -ne '$_ = "GARBAGE\n" if (m{^\S} && $. != 1) .. 0; print;'
+mangle-import
+mangle-done
+
+: ---------- 'test malformed authline' ----------
+
+mangle-start bademail
+# This causes the output syntax check in clogp_authline to trip;
+# (that's the one which is intended to stop us feeding bad data to git).
+perl-i-clog -pe '
+ next unless m{^ -- .* Sat, 12 Jul 2014 20:51:56.*};
+ s{^([^<]+) }{ -- cause <things to choke> };
+'
+mangle-import
+mangle-done
diff --git a/tests/tests/manpages-format b/tests/tests/manpages-format
index 2649a31..ee51dd7 100755
--- a/tests/tests/manpages-format
+++ b/tests/tests/manpages-format
@@ -53,7 +53,6 @@ not_egrep_vxPf () {
}
expected txt dgit.1 <<'END'
-.* # table wider than line width
END
prep () {
diff --git a/tests/tests/mirror b/tests/tests/mirror
index 4aa756b..cedaf56 100755
--- a/tests/tests/mirror
+++ b/tests/tests/mirror
@@ -17,7 +17,7 @@ t-mirror-setup
cd $p
revision=1
t-dgit build
-t-dgit push --new
+t-dgit push-built --new
t-check-mirrored
diff --git a/tests/tests/mirror-debnewgit b/tests/tests/mirror-debnewgit
index 59b96ef..3015d0e 100755
--- a/tests/tests/mirror-debnewgit
+++ b/tests/tests/mirror-debnewgit
@@ -20,7 +20,7 @@ t-cloned-fetched-good
t-commit 'test commit' 3-2
t-dgit build
-t-dgit push
+t-dgit push-built
t-check-mirrored
t-ok
diff --git a/tests/tests/mirror-private b/tests/tests/mirror-private
index 1e885ae..eaf3dad 100755
--- a/tests/tests/mirror-private
+++ b/tests/tests/mirror-private
@@ -17,8 +17,7 @@ revision=1
t-reporefs master
-t-dgit build
-t-dgit push --new
+t-dgit push-source --new
t-check-not-mirrored
t-files-notexist $reposmirror/$p.*
diff --git a/tests/tests/mismatches-contents b/tests/tests/mismatches-contents
index ea0d724..20bf980 100755
--- a/tests/tests/mismatches-contents
+++ b/tests/tests/mismatches-contents
@@ -11,7 +11,7 @@ ln -s $troot/pkg-srcs/${p}_${v%-*}.orig.tar.* .
cd $p
v=1.0-1
-dch -v $v -D unstable -m 'Make a revision'
+t-debchange -v $v -D unstable -m 'Make a revision'
echo foo >us-file
git add us-file debian/changelog
git commit -m "Commit $v"
@@ -19,6 +19,6 @@ git commit -m "Commit $v"
t-dgit build-source
t-expect-fail 'debian/TRASH' \
-t-dgit push --new
+t-dgit push-built --new
t-ok
diff --git a/tests/tests/mismatches-dscchanges b/tests/tests/mismatches-dscchanges
index 85c7086..e73385e 100755
--- a/tests/tests/mismatches-dscchanges
+++ b/tests/tests/mismatches-dscchanges
@@ -19,7 +19,7 @@ check () {
../*.$fext
t-expect-fail "$emsgpat" \
- t-dgit -wgf push --new
+ t-dgit -wgf push-built --new
}
check dsc E:'dpkg-source.*error.*checksum'
@@ -29,6 +29,6 @@ check changes E:'dgit.*hash or size.*varies'
t-dgit -wgf build-source
-t-dgit -wgf push --new
+t-dgit -wgf push-built --new
t-ok
diff --git a/tests/tests/overwrite-chkclog b/tests/tests/overwrite-chkclog
index fee2181..9e2cf88 100755
--- a/tests/tests/overwrite-chkclog
+++ b/tests/tests/overwrite-chkclog
@@ -13,7 +13,7 @@ t-commit 'No changes, just send to stable' '' stable
t-dgit -wgf build
t-expect-fail 'Perhaps debian/changelog does not mention' \
-t-dgit push --overwrite stable
+t-dgit push-built --trust-changelog stable
t-dgit setup-mergechangelogs
@@ -30,7 +30,7 @@ git commit -m 'UNRELEASED changelog'
t-dgit -wgf build
t-expect-fail E:'Distribution.*is UNRELEASED' \
-t-dgit push --overwrite stable
+t-dgit push-built --trust-changelog stable
git revert --no-edit 'HEAD^{/UNRELEASED changelog}'
@@ -41,10 +41,10 @@ git add debian/changelog
git commit -m 'Break changelog'
t-expect-fail 'Perhaps debian/changelog does not mention' \
-t-dgit push --overwrite stable
+t-dgit push-built --trust-changelog stable
git revert --no-edit 'HEAD^{/Break changelog}'
-t-dgit push --overwrite stable
+t-dgit push-built --overwrite stable
t-ok
diff --git a/tests/tests/overwrite-junk b/tests/tests/overwrite-junk
index e11d1f8..978da28 100755
--- a/tests/tests/overwrite-junk
+++ b/tests/tests/overwrite-junk
@@ -17,6 +17,6 @@ t-dgit -wgf build
cd $tmp/git/$p.git; git tag -f $tagpfx/1.2 $tagpfx/1.1
)
-t-dgit push --overwrite=1.2 stable
+t-dgit push-built --overwrite=1.2 stable
t-ok
diff --git a/tests/tests/overwrite-splitbrains b/tests/tests/overwrite-splitbrains
index 815c207..4d50918 100755
--- a/tests/tests/overwrite-splitbrains
+++ b/tests/tests/overwrite-splitbrains
@@ -13,13 +13,13 @@ t-dgit fetch
t-refs-same-start
t-ref-head
-t-expect-fail 'maybe --overwrite is needed' \
-t-dgit --quilt=gbp --dgit-view-save=split.p push
+t-expect-fail 'maybe --trust-changelog is needed' \
+t-dgit --quilt=gbp --dgit-view-save=split.p push-built
t-refs-same-start
t-ref-head
-t-dgit --quilt=gbp --dgit-view-save=split.p --overwrite push
+t-dgit --quilt=gbp --dgit-view-save=split.p --trust-changelog push-built
t-gbp-pushed-good
diff --git a/tests/tests/overwrite-version b/tests/tests/overwrite-version
index 34301ac..9925098 100755
--- a/tests/tests/overwrite-version
+++ b/tests/tests/overwrite-version
@@ -13,8 +13,8 @@ t-commit 'No changes, just send to stable' '' stable
t-dgit -wgf build
t-expect-fail 'HEAD is not a descendant' \
-t-dgit push stable
+t-dgit push-built stable
-t-dgit push --overwrite=1.2 stable
+t-dgit push-built --overwrite=1.2 stable
t-ok
diff --git a/tests/tests/pbuilder b/tests/tests/pbuilder
index 56eed0b..418c4a4 100755
--- a/tests/tests/pbuilder
+++ b/tests/tests/pbuilder
@@ -25,7 +25,7 @@ t-dgit -v0 --pbuilder="$troot/pretend-pbuilder" pbuilder -b
# RC-buggy in that it doesn't build with -A ..
t-dgit -v0 --pbuilder="$troot/pretend-pbuilder" --pbuilder!:--no-source-only-changes pbuilder
-t-dgit -wgf push --new
+t-dgit -wgf push-built --new
t-pushed-good master stable
t-pushed-good-check-changes
diff --git a/tests/tests/push-buildproductsdir b/tests/tests/push-buildproductsdir
index cc1c5e2..ee4b344 100755
--- a/tests/tests/push-buildproductsdir
+++ b/tests/tests/push-buildproductsdir
@@ -25,7 +25,7 @@ mv $p*_* bpd/
mv bpd/*orig* .
cd $p
-t-dgit --build-products-dir=../bpd push
+t-dgit --build-products-dir=../bpd push-built
t-pushed-good dgit/sid
diff --git a/tests/tests/push-newpackage b/tests/tests/push-newpackage
index 79355e3..ac3aaef 100755
--- a/tests/tests/push-newpackage
+++ b/tests/tests/push-newpackage
@@ -9,21 +9,21 @@ t-refs-same-start
t-ref-head
t-expect-push-fail 'package appears to be new in this suite' \
-t-dgit push
+t-dgit push-built
t-dgit build
git checkout bogus
set +e
-(set -e; DGIT_TEST_DEBUG=' ' t-dgit push --new)
+(set -e; DGIT_TEST_DEBUG=' ' t-dgit push-built --new)
rc=$?
set -e
if [ $rc = 0 ]; then fail "push succeeded when tree mismatch"; fi
git checkout master
-t-dgit push --new
+t-dgit push-built --new
t-pushed-good master
diff --git a/tests/tests/push-newrepeat b/tests/tests/push-newrepeat
index 048dfd2..88f4462 100755
--- a/tests/tests/push-newrepeat
+++ b/tests/tests/push-newrepeat
@@ -14,8 +14,8 @@ t-dgit --quilt=smash build-source
t-expect-fail E:'Push failed, while updating the remote git repository' \
t-dgit -cdgit-distro.test-dummy.git-url=file:///dev/enoent/fail \
- push --new
+ push-built --new
-t-dgit push --new --force-reusing-version
+t-dgit push-built --new --force-reusing-version
t-ok
diff --git a/tests/tests/push-nextdgit b/tests/tests/push-nextdgit
index d0436ab..4494231 100755
--- a/tests/tests/push-nextdgit
+++ b/tests/tests/push-nextdgit
@@ -18,7 +18,7 @@ t-refs-same-start
t-ref-head
t-dgit --dpkg-buildpackage:-d build
-t-dgit push
+t-dgit push-source
t-pushed-good dgit/sid
diff --git a/tests/tests/push-source b/tests/tests/push-source
index 79c4636..888b84a 100755
--- a/tests/tests/push-source
+++ b/tests/tests/push-source
@@ -8,11 +8,12 @@ t-buildproductsdir-config
t-prep-newpackage example 1.0
cd $p
+git config --global dgit.default.push-subcmd source
t-refs-same-start
t-ref-head
-t-dgit push-source --new
+t-dgit push --new
t-pushed-good master
t-push-was-source-only
diff --git a/tests/tests/quilt b/tests/tests/quilt
index f26f744..06b646c 100755
--- a/tests/tests/quilt
+++ b/tests/tests/quilt
@@ -25,7 +25,7 @@ iteration () {
t-refs-same-start
t-dgit --dpkg-buildpackage:-d build
- t-dgit push
+ t-dgit push-built
t-pushed-good dgit/sid
}
diff --git a/tests/tests/quilt-colour b/tests/tests/quilt-colour
new file mode 100755
index 0000000..724f561
--- /dev/null
+++ b/tests/tests/quilt-colour
@@ -0,0 +1,19 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+t-archive ruby-rails-3.2 3.2.6-1
+t-git-none
+
+t-dgit clone $p
+cd $p
+
+echo 'added line' >>metadata.yml
+git add metadata.yml
+git commit -m metadata
+
+git config --global color.ui always
+
+t-dgit -wgf build-source
+
+t-ok
diff --git a/tests/tests/quilt-gbp b/tests/tests/quilt-gbp
index e502f6b..e1e53c8 100755
--- a/tests/tests/quilt-gbp
+++ b/tests/tests/quilt-gbp
@@ -22,6 +22,8 @@ t-tstunt-parsechangelog
t-gbp-example-prep
+git config --global init.defaultBranch trunk
+
t-expect-fail 'quilt fixup cannot be linear' \
t-dgit build-source
@@ -43,7 +45,7 @@ test-push-1 () {
}
test-push-2 () {
- t-dgit --quilt=gbp --dgit-view-save=split.p push
+ t-dgit --quilt=gbp --dgit-view-save=split.p push-built
t-gbp-pushed-good
}
@@ -53,7 +55,7 @@ test-push-1
t-dgit --quilt=gbp --clean=git --dgit-view-save=split.b build-source
t-expect-fail "HEAD specifies a different tree to $p" \
- t-dgit push
+ t-dgit push-built
test-push-2
diff --git a/tests/tests/quilt-include-binaries b/tests/tests/quilt-include-binaries
new file mode 100755
index 0000000..74a0de9
--- /dev/null
+++ b/tests/tests/quilt-include-binaries
@@ -0,0 +1,130 @@
+#!/bin/bash
+set -e
+. tests/lib
+t-tstunt-parsechangelog
+
+p=example
+
+mkdir example
+cd example
+git init
+
+r=1
+v0=1.0-$r
+t-dgit import-dsc $troot/pkg-srcs/${p}_${v0}.dsc +import
+
+git reset --hard import
+
+cat >debian/source/include-binaries <<END
+# comment
+
+enoent/file
+bins/file
+debian/binfile
+
+../bin-in-parent
+$tmp/bin-with-abs
+debian/../../bin-tricky-in-parent
+.git/index
+bins/bin-via-link
+$tmp/
+..
+debian/../..
+END
+
+for f in bin-in-parent bin-with-abs bin-tricky-in-parent bin-via-link; do
+ echo SHOULD-NOT-APPEAR-$f >../$f
+done
+
+git add debian/source/include-binaries
+git commit -m 'specify include binaries'
+
+t-prep () {
+ local m=$1
+ git checkout -B work master
+ t-git-next-date
+ r=$(( $r + 1 ))
+ v=1.0-$r
+ t-dch-commit -v$v -m "$1"
+}
+
+t-make-some-bin () {
+ local file="$1"
+ perl -e '
+ use autodie;
+ print pack "H*", "d41d8cd98f00b204e9800998ecf8427e";
+ print "\n'"$file $r"'\n";
+ ' >"$file"
+}
+
+t-try-build-source () {
+ LC_MESSAGES=C LANGUAGE=C \
+ t-dgit --quilt=nofix --since-version=$v0 "$@" build-source
+}
+
+t-roundtrips-1 () {
+ t-try-build-source "$@" 2>&1 | tee ../build-source-out.$r
+ t-dgit import-dsc ../${p}_${v}.dsc +reimport
+ set +e
+ git --no-pager grep SHOULD-NOT-APPEAR reimport --
+ rc=$?
+ set -e
+ test $rc = 1
+ git diff --exit-code work reimport --
+}
+
+t-roundtrips () {
+ t-roundtrips-1
+ t-roundtrips-1 --include-dirty
+}
+
+t-prep 'straightforward'
+
+mkdir bins
+t-make-some-bin bins/file
+git add bins/file
+git commit -m 'add bin'
+
+t-roundtrips
+
+for wrongness in \
+ "forbidden path component '..'" \
+ "path starts with '.git'" \
+; do
+ grep "$wrongness" ../build-source-out.$r
+done
+
+t-prep 'bin via link'
+
+linktarget="$tmp"
+: 'make a new orig, gnagh'
+mkdir ../repack
+cd ../repack
+tar axf $troot/pkg-srcs/${p}_1.0.orig.tar.gz
+ln -s "$linktarget" example/bins
+tar zcf ../${p}_1.1.orig.tar.gz example
+cd ../example
+cp ../${p}_1.{0,1}.orig-docs.tar.gz
+
+v=1.1-$r
+t-dch-commit -v$v -m 'update upstream'
+
+ln -s "$linktarget" bins
+git add bins
+git commit -m 'add bins'
+
+t-roundtrips
+
+t-prep 'ignored weird file'
+
+mkdir bins
+mkfifo bins/file
+
+t-roundtrips-1 -wdn
+
+grep "'bins/file' not a plain file or directory" ../build-source-out.$r
+
+t-expect-fail E:'dpkg-source: error: *new version is named pipe' \
+t-try-build-source -wdn --ignore-dirty
+
+t-ok
diff --git a/tests/tests/quilt-singlepatch b/tests/tests/quilt-singlepatch
index 9c03595..68982a2 100755
--- a/tests/tests/quilt-singlepatch
+++ b/tests/tests/quilt-singlepatch
@@ -24,7 +24,7 @@ t-ref-head
t-dgit -wgf build-source
-t-dgit push
+t-dgit push-built
t-pushed-good dgit/sid
diff <<END - debian/patches/series
@@ -40,6 +40,6 @@ git apply --reverse debian/patches/debian-changes
git commit -a -m 'go back to plain upstream'
t-dgit -wgf build-source
-t-dgit --damp-run --force-reusing-version push
+t-dgit --damp-run --force-reusing-version push-built
t-ok
diff --git a/tests/tests/quilt-splitbrains b/tests/tests/quilt-splitbrains
index f8d8091..4c683c0 100755
--- a/tests/tests/quilt-splitbrains
+++ b/tests/tests/quilt-splitbrains
@@ -26,7 +26,9 @@ want-success () {
t-dgit "$@" --quilt=$qmode --dgit-view-save=split.b build-source
- t-dgit "$@" --quilt=$qmode --dgit-view-save=split.p push
+ $want_success_pre_push_hook
+
+ t-dgit "$@" --quilt=$qmode --dgit-view-save=split.p push-built
t-$qmode-pushed-good $suite
}
@@ -77,7 +79,10 @@ t-dgit -wgf --quilt=gbp build-source
t-expect-fail 'This might be a patches-unapplied branch' \
t-dgit -wgf build-source
+# Check that push-built regenerates the cache if necessary
+want_success_pre_push_hook='git update-ref -d refs/dgit-intern/quilt-cache'
want-success unapplied -wgf
+want_success_pre_push_hook=''
echo "===== making fully-applied tree suitable for --quilt-check ====="
@@ -101,7 +106,7 @@ t-dgit --quilt=unapplied build-source
t-dgit --quilt=nofix build-source
t-refs-same-start
t-ref-head
-t-dgit --quilt=nofix push
+t-dgit --quilt=nofix push-built
t-pushed-good-core
diff --git a/tests/tests/rpush b/tests/tests/rpush
index 71bbe2b..3378da9 100755
--- a/tests/tests/rpush
+++ b/tests/tests/rpush
@@ -17,13 +17,32 @@ debcommit -a
t-refs-same-start
t-ref-head
-t-dgit --dpkg-buildpackage:-d build
+t-dgit-rpush () {
+ t-dgit "$@" --ssh=$troot/ssh rpush somehost:$tmp/$p
+}
mkdir $tmp/empty
cd $tmp/empty
-#t-dgit --ssh=$troot/ssh rpush somehost:$troot/$p
-#echo $?
-t-dgit --ssh=$troot/ssh rpush somehost:$tmp/$p
+
+t-expect-fail F:'error: looked for .dsc' \
+t-dgit-rpush -cdgit.default.rpush-subcmd=built
+
+t-expect-fail F:'error: looked for .dsc' \
+t-dgit-rpush -cdgit.default.push-subcmd=built
+
+cd $tmp/$p
+
+t-dgit --dpkg-buildpackage:-d build
+
+cd $tmp/empty
+
+t-expect-fail F:'dgit rpush, but dgit.default.[r]push-subcmd set to reject' \
+t-dgit-rpush -cdgit.default.rpush-subcmd=reject
+
+t-expect-fail F:'dgit rpush, but dgit.default.[r]push-subcmd set to reject' \
+t-dgit-rpush
+
+t-dgit-rpush -cdgit.default.rpush-subcmd=built
cd $tmp/$p
t-pushed-good dgit/sid
diff --git a/tests/tests/rpush-quilt b/tests/tests/rpush-quilt
index bb49fc6..aca403a 100755
--- a/tests/tests/rpush-quilt
+++ b/tests/tests/rpush-quilt
@@ -11,7 +11,7 @@ t-dgit -wgf --quilt=gbp --dgit-view-save=split.b build-source
mkdir $tmp/empty
cd $tmp/empty
t-dgit --quilt=gbp --dgit-view-save=split.p \
- --ssh=$troot/ssh rpush somehost:$tmp/$p
+ --ssh=$troot/ssh rpush-built somehost:$tmp/$p
cd $tmp/$p
t-gbp-pushed-good
diff --git a/tests/tests/rpush-source b/tests/tests/rpush-source
new file mode 100755
index 0000000..465cf1c
--- /dev/null
+++ b/tests/tests/rpush-source
@@ -0,0 +1,27 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+t-archive pari-extra 3-1
+t-git pari-extra 3-1
+
+t-dgit clone $p
+
+cd $p
+t-cloned-fetched-good
+
+v=3-2~dummy1
+t-apply-diff 3-1 $v
+debcommit -a
+
+t-refs-same-start
+t-ref-head
+
+mkdir $tmp/empty
+cd $tmp/empty
+t-dgit --ssh=$troot/ssh rpush-source somehost:$tmp/$p
+
+cd $tmp/$p
+t-pushed-good dgit/sid
+
+t-ok
diff --git a/tests/tests/sbuild-gitish b/tests/tests/sbuild-gitish
index da90b6f..6b4d812 100755
--- a/tests/tests/sbuild-gitish
+++ b/tests/tests/sbuild-gitish
@@ -17,6 +17,7 @@ buildrune=$(
next if !m/\S/ .. 0;
s/^ +\%//;
$fixchr += s/(\s-c\s*)jessie(\s|$)/$1'"$schroot"'$2/;
+ s/^\s*sbuild/$& -v/m;
print or die $!;
END { $fixchr == 1 or die $fixchr; }
'
diff --git a/tests/tests/sourceonlypolicy b/tests/tests/sourceonlypolicy
index b0569c3..ec365a6 100755
--- a/tests/tests/sourceonlypolicy
+++ b/tests/tests/sourceonlypolicy
@@ -29,7 +29,7 @@ t-commit 'Now with binaries'
t-dgit -wgf build
t-expect-fail E:'uploading binaries.*source only' \
-dgit-with-policy always push --new
+dgit-with-policy always push-built --new
t-commit 'Source-only not NEW'
diff --git a/tests/tests/tag-updates b/tests/tests/tag-updates
index 824fd1e..7a17a8b 100755
--- a/tests/tests/tag-updates
+++ b/tests/tests/tag-updates
@@ -7,8 +7,7 @@ t-prep-newpackage example 1.0
cd $p
revision=1
-t-dgit build
-t-dgit push --new
+t-dgit push-source --new
tagref=`t-v-tag`
tagname=${tn#refs/tags}
diff --git a/tests/tests/tagupl b/tests/tests/tagupl
index 9d3e45a..3bb683d 100755
--- a/tests/tests/tagupl
+++ b/tests/tests/tagupl
@@ -103,8 +103,9 @@ expect-email () {
}
raw-mangled () {
- git update-ref refs/tags/$tagname \
- $(git hash-object -w -t tag ../tagobj-$ident)
+ local tagobj
+ tagobj=$(git hash-object -w -t tag ../tagobj-$ident)
+ git update-ref refs/tags/$tagname "$tagobj"
t-tagupl-run-drs $tmp/$p
}
@@ -177,8 +178,16 @@ perl -pe <../raw-base '
' >../tagobj-$ident
echo >>../tagobj-$ident
cat ../basetag >>../tagobj-$ident
-raw-mangled
-grep 'failed to fish tagger out of tag' ../tagupl/overall.log
+set +e
+(set -e; LC_MESSAGES=C raw-mangled 2>../mktag.err)
+rc=$?
+set -e
+if [ $rc = 0 ]; then
+ grep 'failed to fish tagger out of tag' ../tagupl/overall.log
+elif [ $rc = 128 ] && egrep 'error: object fails fsck: badTimezone: invalid author/committer line - bad time zone' ../mktag.err; then :
+else
+ fatal 'failed to make raw-mangled'
+fi
cd ..
rm -rf $p
diff --git a/tests/tests/trustingpolicy-replay b/tests/tests/trustingpolicy-replay
index a2d280d..f96165f 100755
--- a/tests/tests/trustingpolicy-replay
+++ b/tests/tests/trustingpolicy-replay
@@ -16,18 +16,15 @@ cd $p
revision=1
git tag start
-t-dgit build
-t-dgit push --new
+t-dgit push-source --new
t-rm-dput-dropping
t-commit 'Prep v1.1 which will be rewound'
-t-dgit build
-t-dgit push
+t-dgit push-source
git checkout $tagpfx/1.0
-t-dgit build
-t-dgit push --deliberately-fresh-repo --force-reusing-version
+t-dgit push-source --deliberately-fresh-repo --force-reusing-version
remote="`git config dgit-distro.test-dummy.git-url`/$p.git"
@@ -53,7 +50,8 @@ prepare-replay () {
t-commit "request with $delib that we will replay"
t-dgit build
t-expect-push-fail 'system: No such file or directory' \
- t-dgit push $delib
+ t-dgit -cdgit-distro.test-dummy.policy-query-supported-ssh=false \
+ push-source $delib
t-policy dgit-repos-policy-trusting
@@ -79,8 +77,7 @@ attempt-replay 'does not declare previously heads/for-testing'
prepare-replay --deliberately-not-fast-forward
t-commit 'later version to stop not fast forward rewinding'
-t-dgit build
-t-dgit push
+t-dgit push-source
attempt-replay "does not declare previously tags/$tagpfx/$v"
diff --git a/tests/tests/unrepresentable b/tests/tests/unrepresentable
index e4b0da8..8f451aa 100755
--- a/tests/tests/unrepresentable
+++ b/tests/tests/unrepresentable
@@ -10,58 +10,131 @@ ln -s $troot/pkg-srcs/${p}_${v%-*}.orig.tar.* .
cd $p
-start () { git checkout quilt-tip-1.1~0; }
-attempt () { t-dgit -wgf --quilt=smash quilt-fixup; }
-good () {
- attempt
+make_singlepatch () {
+ git checkout quilt-tip-1.1
+ echo >debian/source/options single-debian-patch
+ git add debian/source/options
+ git commit -m single-debian-patch debian/source/options
+}
+
+quilt_mode=smash
+case $DGIT_TEST_TESTNAME in
+ *-single-dpkg) make_singlepatch ;;
+ *-single-git) quilt_mode=single ;;
+ *-*) fail 'unknown test name' ;;
+ *) ;;
+esac
+
+quilt-fixup () {
+ t-dgit -wgf --quilt=$quilt_mode quilt-fixup
+}
+build-source () {
t-dgit --quilt=nofix -wgf build-source
- t-dgit -wgf --dry-run push --new
+}
+run-push () {
+ t-dgit -wgf --dry-run push-built --new
+}
+badly-raw () {
+ wrongmsg=$1
+ t-expect-fail "$1" \
+ quilt-fixup
+}
+badly-late-raw () {
+ quilt-fixup
+ build-source
+ t-expect-fail "$1" \
+ run-push
+}
+good () {
+ quilt-fixup
+ build-source
+ run-push
}
-badly-1 () {
- wrongfn=$1
- wrongmsg=$2
- start
+start () {
+ path=$1
+ git checkout quilt-tip-1.1~0;
}
+finish () {
+ case "$DGIT_TEST_TESTNAME" in
+ *-single-dpkg) expected=${2-$1} ;;
+ *) expected=$1 ;;
+ esac
+
+ case "$expected" in
+ NOTHING) ;;
+ *) git commit -m "$expected" ;;
+ esac
-badly-2 () {
- git commit -m "Commit wrongness $wrongfn ($wrongmsg)"
- t-expect-fail E:"cannot represent change: $wrongmsg .*: $wrongfn" \
- attempt
+ case "$expected" in
+ GOOD:*|NOTHING)
+ good
+ ;;
+
+ EP:*)
+ wrongmsg="${expected#*:}"
+ badly-raw E:"cannot represent change: $wrongmsg .*: $path"
+ ;;
+
+ LATE-EP:*)
+ # quilt-fixup and dpkg-source succeeded, but dgit push failed.
+ # This is rather a poor outcome.
+ case "$DGIT_TEST_TESTNAME" in
+ *-single-dpkg) ;;
+ *) fail 'push failure, other than with single-debina-patch' ;;
+ esac
+
+ wrongmsg="${expected#*:}"
+ badly-late-raw "E:$wrongmsg.*: $path"
+ ;;
+
+ E:* | [^A-Z]*)
+ badly-raw "$expected"
+ ;;
+
+ *) fail 'bad pattern' ;;
+
+ esac
}
-badly-1 orig-symlink 'modified symlink'
+start orig-symlink
ln -sf NEWTARGET orig-symlink
git add orig-symlink
-badly-2
+finish EP:'modified symlink' 'new version is symlink'
-badly-1 orig-symlink 'deletion of symlink'
+start orig-symlink
git rm -f orig-symlink
-badly-2
+finish EP:'deletion of symlink' LATE-EP:'Mode change from 20000 to 000000'
+
+start new
+ ln -s hi new
+ git add new
+finish EP:'creation .* symlink' 'new version is symlink'
-start
+start src.c
git rm src.c
- git commit -m deleted
-good
+finish GOOD:deleted
-start
+start orig-exec
git rm orig-exec
+finish GOOD:'deleted exec'
+
+start orig-unwriteable
git rm -f orig-unwriteable
- git commit -m 'deleted funny'
-good
+finish GOOD:'deleted unwritable'
-badly-1 src.c 'mode or type changed'
+start src.c
chmod +x src.c
git add src.c
-badly-2
+finish GOOD:chmod LATE-EP:'Mode change from 644 to 755'
-badly-1 new 'creation with non-default mode'
- echo hi >new
- chmod 755 new
- git add new
-badly-2
+start newx
+ echo hi >newx
+ chmod 755 newx
+ git add newx
+finish GOOD:add-755 LATE-EP:'Mode change from 644 to 755'
-start
-good
+start nothing
+finish NOTHING NOTHING
t-ok
diff --git a/tests/tests/unrepresentable-single-dpkg b/tests/tests/unrepresentable-single-dpkg
new file mode 100755
index 0000000..f1ac270
--- /dev/null
+++ b/tests/tests/unrepresentable-single-dpkg
@@ -0,0 +1,4 @@
+#!/bin/bash
+set -e
+. tests/lib
+t-chain-test unrepresentable
diff --git a/tests/tests/unrepresentable-single-git b/tests/tests/unrepresentable-single-git
new file mode 100755
index 0000000..f1ac270
--- /dev/null
+++ b/tests/tests/unrepresentable-single-git
@@ -0,0 +1,4 @@
+#!/bin/bash
+set -e
+. tests/lib
+t-chain-test unrepresentable
diff --git a/tests/tests/version-opt b/tests/tests/version-opt
index 2933912..fff9a4d 100755
--- a/tests/tests/version-opt
+++ b/tests/tests/version-opt
@@ -13,8 +13,7 @@ revision=1
git tag start
t-dgit setup-mergechangelogs
-t-dgit build-source
-t-dgit push --new --overwrite
+t-dgit push-source --new --overwrite
t-archive-process-incoming sid
diff --git a/tests/tstunt/Dpkg/Changelog/Parse.pm b/tests/tstunt/Dpkg/Changelog/Parse.pm
index d69b7df..c0efdf1 100644
--- a/tests/tstunt/Dpkg/Changelog/Parse.pm
+++ b/tests/tstunt/Dpkg/Changelog/Parse.pm
@@ -19,7 +19,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
package Dpkg::Changelog::Parse;
diff --git a/tests/update-dh-compat b/tests/update-dh-compat
new file mode 100755
index 0000000..b198771
--- /dev/null
+++ b/tests/update-dh-compat
@@ -0,0 +1,120 @@
+#!/bin/bash
+# dgit
+# Integration between git and Debian-style archives
+#
+# Copyright (C)2013-2021 Ian Jackson
+# Copyright (C)2017-2019 Sean Whitton
+# Copyright (C)2019 Matthew Vernon / Genome Research Limited
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+set -e
+
+# This ad-hoc script was wrtten to deal with #1002927.
+
+export FILTER_BRANCH_SQUELCH_WARNING=1
+toplevel=$PWD
+
+cd_fresh_d () {
+ cd "$toplevel"
+ rm -rf d
+ mkdir d
+ cd d
+}
+
+adjust="$toplevel"/tests/update-dh-compat-adjust
+adjust () { "$adjust"; }
+
+git_filter_strip_origs () {
+ git for-each-ref refs/original \
+ --format '%(refname)' |
+ xargs -rn1 git update-ref -d
+}
+
+adjust_git_filter () {
+ # this is the dgit origin commit; this check may stop
+ # us rewriting our normal dgit tree
+ set +e
+ git cat-file -e 06fb75074c0bebccdcf86385b8d248fd127ed66d
+ rc=$?
+ set -e
+ test $rc = 1
+
+ git_filter_strip_origs
+
+ git filter-branch \
+ --tree-filter "$adjust" \
+ --tag-name-filter cat \
+ -- --all
+
+ git_filter_strip_origs
+
+ git gc --aggressive --prune=all
+}
+
+cd "$toplevel"
+
+for f in tests/pkg-srcs/*.dsc; do
+ cd_fresh_d
+
+ dpkg-source -x ../$f p
+ cd p
+ adjust
+ dpkg-source -b .
+ cd ..
+ dcmd rm ../$f
+ dcmd mv *.dsc ../tests/pkg-srcs/
+
+ cd ..
+done
+
+cd "$toplevel"
+
+for f in tests/git-srcs/*.tar; do
+ cd_fresh_d
+
+ tar xf ../$f
+
+ p=$(echo *)
+ cd $p
+ adjust_git_filter
+ cd ..
+ tar cf ../$f $p
+
+ cd ..
+done
+
+cd "$toplevel"
+
+for f in tests/worktrees/*.tar; do
+ cd_fresh_d
+
+ tar xf ../$f
+
+ p=$(echo *)
+ cd $p
+ adjust_git_filter
+ adjust
+ cd ..
+
+ tar cf ../$f $p
+
+ cd ..
+done
+
+cd "$toplevel"
+
+rm -rf d
+
+echo ok.
diff --git a/tests/update-dh-compat-adjust b/tests/update-dh-compat-adjust
new file mode 100755
index 0000000..04cd0a6
--- /dev/null
+++ b/tests/update-dh-compat-adjust
@@ -0,0 +1,26 @@
+#!/bin/sh
+# dgit
+# Integration between git and Debian-style archives
+#
+# Copyright (C)2013-2021 Ian Jackson
+# Copyright (C)2017-2019 Sean Whitton
+# Copyright (C)2019 Matthew Vernon / Genome Research Limited
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+# See update-dh-compat
+# This ad-hoc script was wrtten to deal with #1002927.
+
+set -e
+perl -i -pe 's/^5$/12/' debian/compat
diff --git a/tests/worktrees/example_1.0.tar b/tests/worktrees/example_1.0.tar
index 11f694f..658cddc 100644
--- a/tests/worktrees/example_1.0.tar
+++ b/tests/worktrees/example_1.0.tar
Binary files differ
diff --git a/tests/worktrees/example_1.1.tar b/tests/worktrees/example_1.1.tar
index f58c41a..2c257a3 100644
--- a/tests/worktrees/example_1.1.tar
+++ b/tests/worktrees/example_1.1.tar
Binary files differ
diff --git a/tests/worktrees/pari-extra_3-1.tar b/tests/worktrees/pari-extra_3-1.tar
index 56b797d..201f6f5 100644
--- a/tests/worktrees/pari-extra_3-1.tar
+++ b/tests/worktrees/pari-extra_3-1.tar
Binary files differ
diff --git a/tests/worktrees/pari-extra_drs.tar b/tests/worktrees/pari-extra_drs.tar
index 94c8455..987b595 100644
--- a/tests/worktrees/pari-extra_drs.tar
+++ b/tests/worktrees/pari-extra_drs.tar
Binary files differ
diff --git a/tests/worktrees/ruby-rails-3.2_test.tar b/tests/worktrees/ruby-rails-3.2_test.tar
index 6b0a824..eda72b2 100644
--- a/tests/worktrees/ruby-rails-3.2_test.tar
+++ b/tests/worktrees/ruby-rails-3.2_test.tar
Binary files differ