summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/enumerate-tests2
-rw-r--r--tests/lib3
-rw-r--r--tests/lib-core2
-rwxr-xr-xtests/tests/clone-skew35
-rwxr-xr-xtests/tests/debpolicy-newreject10
-rwxr-xr-xtests/tests/debpolicy-taintrm3
-rwxr-xr-xtests/tests/gdr-edits3
-rwxr-xr-xtests/tests/mirror4
-rwxr-xr-xtests/tests/push-newrepeat2
-rwxr-xr-xtests/tests/quilt-singlepatch2
-rwxr-xr-xtests/tests/trustingpolicy-replay2
11 files changed, 57 insertions, 11 deletions
diff --git a/tests/enumerate-tests b/tests/enumerate-tests
index 680236e..9b9271c 100755
--- a/tests/enumerate-tests
+++ b/tests/enumerate-tests
@@ -42,7 +42,7 @@ finish- () {
test-begin-gencontrol () {
restrictions=''
- dependencies='dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime'
+ dependencies='dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime, liburi-perl'
}
gencontrol-add-things () {
diff --git a/tests/lib b/tests/lib
index 8392e79..c03f34a 100644
--- a/tests/lib
+++ b/tests/lib
@@ -362,7 +362,8 @@ t-archive () {
v=$2
local dscf=${p}_$2.dsc
rm -f $tmp/mirror/pool/main/${p}_*
- ln -s $troot/pkg-srcs/${p}_${2%-*}* $tmp/mirror/pool/main/
+ ${t_archive_ln_s-ln -s} \
+ $troot/pkg-srcs/${p}_${2%-*}* $tmp/mirror/pool/main/
t-archive-query $suite
rm -rf $tmp/extract
mkdir $tmp/extract
diff --git a/tests/lib-core b/tests/lib-core
index 7e98acf..7fdddb4 100644
--- a/tests/lib-core
+++ b/tests/lib-core
@@ -11,6 +11,7 @@ t-set-intree () {
: ${DGIT_BADCOMMIT_FIXUP:=$DGIT_TEST_INTREE/dgit-badcommit-fixup}
: ${DGIT_REPOS_SERVER_TEST:=$DGIT_TEST_INTREE/infra/dgit-repos-server}
: ${DGIT_SSH_DISPATCH_TEST:=$DGIT_TEST_INTREE/infra/dgit-ssh-dispatch}
+: ${DGIT_MIRROR_SSH_WRAP_TEST:=$DGIT_TEST_INTREE/infra/dgit-mirror-ssh-wrap}
: ${DGIT_DEBPUSH_TEST:=$DGIT_TEST_INTREE/git-debpush}
: ${DGIT_INFRA_PFX:=$DGIT_TEST_INTREE${DGIT_TEST_INTREE:+/infra/}}
: ${DGIT_GITDEBREBASE_TEST:=$DGIT_TEST_INTREE/git-debrebase}
@@ -18,6 +19,7 @@ t-set-intree () {
: ${DEBPUSH_GIT_PLAYTREE_SETUP:=$DGIT_TEST_INTREE/git-playtree-setup}
export DGIT_TEST DGIT_BADCOMMIT_FIXUP
export DGIT_REPOS_SERVER_TEST DGIT_SSH_DISPATCH_TEST
+ export DGIT_MIRROR_SSH_WRAP_TEST
export DGIT_MANPAGES_SOURCE_DIR DEBPUSH_GIT_PLAYTREE_SETUP
export PERLLIB="$DGIT_TEST_INTREE${PERLLIB:+:}${PERLLIB}"
}
diff --git a/tests/tests/clone-skew b/tests/tests/clone-skew
new file mode 100755
index 0000000..dd51acd
--- /dev/null
+++ b/tests/tests/clone-skew
@@ -0,0 +1,35 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+t-dependencies libhttp-server-simple-static-perl
+
+$troot/http-static-server >$tmp/must-clean/mirror.port $tmp/mirror
+read <$tmp/must-clean/mirror.port mirror_port
+
+t-git-config --global dgit-distro.test-dummy.mirror \
+ http://127.0.0.1:$mirror_port/
+
+t_archive_ln_s=cp
+
+t-archive example 1.0-1
+t-git-none
+
+perl -i -ne '
+ print or die $!;
+ s/1.0-1/1.0-1+0.1/g;
+ s/ \w/ sprintf " %x", $& ^ 1 /e;
+ print or die $!;
+' $tmp/aq/package.sid.$p
+t-aq-archive-updated sid $p
+
+LC_MESSAGES=C \
+t-dgit clone $p 2>&1 |tee got.message
+
+grep 'Warning: archive skew detected.' got.message
+egrep 'We were able to obtain only *1.0-1$' got.message
+
+cd $p
+t-cloned-fetched-good
+
+t-ok
diff --git a/tests/tests/debpolicy-newreject b/tests/tests/debpolicy-newreject
index 1fa6751..af02ac1 100755
--- a/tests/tests/debpolicy-newreject
+++ b/tests/tests/debpolicy-newreject
@@ -57,7 +57,8 @@ t-git-dir-check enoent
vanished=$v
-t-dgit push --new --deliberately-include-questionable-history
+t-dgit push --new --deliberately-include-questionable-history \
+ --force-reusing-version
t-git-dir-check secret
t-policy-periodic
@@ -81,7 +82,7 @@ t-expect-push-fail \
"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 push
+t-dgit --deliberately-not-fast-forward --force-reusing-version push
cd $dgitrepo
t-expect-push-fail "Not a valid object name" \
@@ -94,7 +95,8 @@ t-expect-push-fail \
"Package is in NEW and has not been accepted or rejected yet" \
t-dgit push
-t-dgit push --deliberately-include-questionable-history
+t-dgit push --deliberately-include-questionable-history \
+ --force-reusing-version
t-archive-process-incoming sid
@@ -116,6 +118,6 @@ t-dgit pull
t-dgit build
t-expect-push-fail \
'Reason: rewound suite sid; --deliberately-not-fast-forward specified' \
-t-dgit push
+t-dgit --force-reusing-version push
t-ok
diff --git a/tests/tests/debpolicy-taintrm b/tests/tests/debpolicy-taintrm
index 8655fb5..a9e54da 100755
--- a/tests/tests/debpolicy-taintrm
+++ b/tests/tests/debpolicy-taintrm
@@ -35,7 +35,8 @@ t-expect-push-fail \
'all previously pushed versions were found to have been removed from NEW' \
t-dgit push-source --new
-t-dgit push-source --new --deliberately-include-questionable-history
+t-dgit push-source --new --deliberately-include-questionable-history \
+ --force-reusing-version
t-archive-process-incoming new
diff --git a/tests/tests/gdr-edits b/tests/tests/gdr-edits
index 0bdf15f..a8b519c 100755
--- a/tests/tests/gdr-edits
+++ b/tests/tests/gdr-edits
@@ -27,6 +27,9 @@ t-gdr-good laundered
t-dgit push-source
t-gdr-good pushed-interop
+t-expect-fail E:'add a new changelog stanza.*and try again' \
+t-dgit push-source
+
git branch before-noop
t-git-next-date
diff --git a/tests/tests/mirror b/tests/tests/mirror
index 4947688..4aa756b 100755
--- a/tests/tests/mirror
+++ b/tests/tests/mirror
@@ -31,7 +31,9 @@ set -ex
: $sentinel
cat >&2 $sentinel
shift # eat HOST
-sh -c "\$*"
+export SSH_ORIGINAL_COMMAND="\$*"
+exec \${DGIT_MIRROR_SSH_WRAP_TEST-dgit-mirror-ssh-wrap} \
+ '$tmp/git-mirror/' .git --
END
chmod +x $tmp/stunt-ssh
diff --git a/tests/tests/push-newrepeat b/tests/tests/push-newrepeat
index 87fcb35..048dfd2 100755
--- a/tests/tests/push-newrepeat
+++ b/tests/tests/push-newrepeat
@@ -16,6 +16,6 @@ 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
-t-dgit push --new
+t-dgit push --new --force-reusing-version
t-ok
diff --git a/tests/tests/quilt-singlepatch b/tests/tests/quilt-singlepatch
index 320a31c..9c03595 100755
--- a/tests/tests/quilt-singlepatch
+++ b/tests/tests/quilt-singlepatch
@@ -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 push
+t-dgit --damp-run --force-reusing-version push
t-ok
diff --git a/tests/tests/trustingpolicy-replay b/tests/tests/trustingpolicy-replay
index 2a1012b..a2d280d 100755
--- a/tests/tests/trustingpolicy-replay
+++ b/tests/tests/trustingpolicy-replay
@@ -27,7 +27,7 @@ t-dgit push
git checkout $tagpfx/1.0
t-dgit build
-t-dgit push --deliberately-fresh-repo
+t-dgit push --deliberately-fresh-repo --force-reusing-version
remote="`git config dgit-distro.test-dummy.git-url`/$p.git"