summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/git-srcs/pari-extra_3-1.git.tarbin51200 -> 40960 bytes
-rw-r--r--tests/lib9
-rw-r--r--tests/lib-baredebian18
-rw-r--r--tests/lib-build-modes1
-rw-r--r--tests/lib-core3
-rwxr-xr-xtests/setup/gbp48
-rwxr-xr-xtests/tests/fetch-somegit-notlast2
-rwxr-xr-xtests/tests/gbp-orig42
-rwxr-xr-xtests/tests/tagupl33
-rwxr-xr-xtests/tests/tagupl-baredebian38
-rwxr-xr-xtests/tests/tagupl-gbp28
-rwxr-xr-xtests/tests/tagupl-native1
12 files changed, 170 insertions, 53 deletions
diff --git a/tests/git-srcs/pari-extra_3-1.git.tar b/tests/git-srcs/pari-extra_3-1.git.tar
index 1673c72..6392d83 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/lib b/tests/lib
index 35dbb1e..78ec9a7 100644
--- a/tests/lib
+++ b/tests/lib
@@ -777,11 +777,12 @@ t-splitbrain-pushed-good-start () {
t-refs-same-start
t-ref-same refs/heads/split.p
- case "$(t-git-get-ref refs/heads/split.b)" in
+ local split_b=$(t-git-get-ref refs/heads/split.b)
+ case "$split_b" in
"$t_ref_val") ;;
"$(git rev-parse refs/heads/split.p^0)") ;;
"$(git rev-parse refs/heads/split.p^1)") ;;
- *) fail 'bad b/p' ;;
+ *) fail "bad b/p (b=$split_b)" ;;
esac
t-pushed-good-core
@@ -1027,7 +1028,6 @@ t-git-pseudo-merge () {
}
t-gbp-example-prep-no-ff () {
- t-tstunt-parsechangelog
t-archive example 1.0-1
t-git-none
t-worktree 1.0
@@ -1187,7 +1187,7 @@ t-debpolicy () {
t-dsd
t-policy dgit-repos-policy-debian
- mkdir $tmp/git
+ mkdir -p $tmp/git
t-policy-admin create-db
}
@@ -1236,7 +1236,6 @@ t-tagupl-test () {
cd ../$p
t-dgit fetch
- t-pushed-good master
}
t-buildproductsdir-config () {
diff --git a/tests/lib-baredebian b/tests/lib-baredebian
index 3ef6569..557c051 100644
--- a/tests/lib-baredebian
+++ b/tests/lib-baredebian
@@ -23,7 +23,7 @@ baredebian-test-minimum () {
t-dgit -wn --dgit-view-save=split.f1 --$quiltmode quilt-fixup
}
-baredebian-test-core () {
+baredebian-test-core-prepush () {
tar --strip-components=1 -axf ../$origbase.tar.*
for comp in $xorigcomps; do
mkdir $comp
@@ -56,14 +56,22 @@ baredebian-test-core () {
git add debian/patches/.
t-commit 'extra patch made with quilt' 1.0-2
+ t-refs-same-start
+ t-ref-head
+ t-dgit -wn --quilt=$quiltmode --dgit-view-save=split.b quilt-fixup
+ t-ref-head
+}
+
+baredebian-test-core-push () {
dpkg-buildpackage -uc -us --build=source
# ^ Do this by hand here not because we expect users to do this
# (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.b quilt-fixup
t-dgit -wn --quilt=$quiltmode --dgit-view-save=split.p --new push
+}
+baredebian-test-core-postpush () {
git merge-base --is-ancestor HEAD split.p
if [ "$uvtag" ]; then
git merge-base --is-ancestor $uvtag split.p
@@ -86,6 +94,12 @@ baredebian-test-core () {
t-splitbrain-pushed-good-end-made-dep14
}
+baredebian-test-core () {
+ baredebian-test-core-prepush
+ baredebian-test-core-push
+ baredebian-test-core-postpush
+}
+
baredebian-test () {
baredebian-test-vars
baredebian-test-minimum
diff --git a/tests/lib-build-modes b/tests/lib-build-modes
index 27c5b06..a4482be 100644
--- a/tests/lib-build-modes
+++ b/tests/lib-build-modes
@@ -44,6 +44,7 @@ bm-prep () {
bm-gbp-example-acts () {
t-gbp-example-prep
+ t-tstunt-parsechangelog
git checkout -b for-build-modes qc/quilt-tip-2
# build-modes cannot cope with branches containing /
diff --git a/tests/lib-core b/tests/lib-core
index bdf3a6c..7e98acf 100644
--- a/tests/lib-core
+++ b/tests/lib-core
@@ -15,9 +15,10 @@ t-set-intree () {
: ${DGIT_INFRA_PFX:=$DGIT_TEST_INTREE${DGIT_TEST_INTREE:+/infra/}}
: ${DGIT_GITDEBREBASE_TEST:=$DGIT_TEST_INTREE/git-debrebase}
: ${DGIT_MANPAGES_SOURCE_DIR:=$DGIT_TEST_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_MANPAGES_SOURCE_DIR
+ export DGIT_MANPAGES_SOURCE_DIR DEBPUSH_GIT_PLAYTREE_SETUP
export PERLLIB="$DGIT_TEST_INTREE${PERLLIB:+:}${PERLLIB}"
}
diff --git a/tests/setup/gbp b/tests/setup/gbp
new file mode 100755
index 0000000..d8675fe
--- /dev/null
+++ b/tests/setup/gbp
@@ -0,0 +1,48 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+t-archive-none example
+t-git-none
+t-worktree 1.0
+
+cd $p
+
+: '----- construct an unpatched branch with patches -----'
+
+git checkout patch-queue/quilt-tip
+gbp pq export
+: 'now on quilt-tip'
+git add debian/patches
+git commit -m 'Commit patch queue'
+
+: '----- construct an upstream branch -----'
+
+git checkout --orphan upstream
+git reset --hard
+git clean -xdf
+
+tar --strip-components=1 -xf $troot/pkg-srcs/${p}_1.0.orig.tar.gz
+
+mkdir docs
+cd docs
+tar --strip-components=1 -xf $troot/pkg-srcs/${p}_1.0.orig-docs.tar.gz
+cd ..
+
+git add -Af .
+git commit -m 'Import 1.0'
+git tag upstream/1.0
+
+git checkout quilt-tip
+t-git-pseudo-merge -m 'gbp-orig pseudomerge' upstream
+
+v=1.0-1
+
+git checkout -B master
+
+cd ..
+
+t-setup-done 'v' "$(echo $p*) git mirror aq" '
+ t-select-package example
+ t-git-next-date
+'
diff --git a/tests/tests/fetch-somegit-notlast b/tests/tests/fetch-somegit-notlast
index 63abe8a..4e42aa3 100755
--- a/tests/tests/fetch-somegit-notlast
+++ b/tests/tests/fetch-somegit-notlast
@@ -10,6 +10,6 @@ t-dgit clone $p
cd $p
t-cloned-fetched-good
-t-has-ancestor debian/3-1
+t-has-ancestor test-dummy/3-1
t-ok
diff --git a/tests/tests/gbp-orig b/tests/tests/gbp-orig
index 9a4937c..c843663 100755
--- a/tests/tests/gbp-orig
+++ b/tests/tests/gbp-orig
@@ -2,49 +2,17 @@
set -e
. tests/lib
-t-tstunt-parsechangelog
-t-tstunt-debuild
-t-tstunt-lintian
-
-t-archive-none example
-t-git-none
-t-worktree 1.0
+t-setup-import gbp
cd $p
-: '----- construct an unpatched branch with patches -----'
-
-git checkout patch-queue/quilt-tip
-gbp pq export
-: 'now on quilt-tip'
-git add debian/patches
-git commit -m 'Commit patch queue'
-
-: '----- construct an upstream branch -----'
-
-git checkout --orphan upstream
-git reset --hard
-git clean -xdf
-
-tar --strip-components=1 -xf $troot/pkg-srcs/${p}_1.0.orig.tar.gz
-
-mkdir docs
-cd docs
-tar --strip-components=1 -xf $troot/pkg-srcs/${p}_1.0.orig-docs.tar.gz
-cd ..
-
-git add -Af .
-git commit -m 'Import 1.0'
-git tag upstream/1.0
-
-git checkout quilt-tip
-t-git-pseudo-merge -m 'gbp-orig pseudomerge' upstream
-
-v=1.0-1
+t-tstunt-parsechangelog
+t-tstunt-debuild
+t-tstunt-lintian
: '----- let gbp build a .orig for comparison -----'
-gbp buildpackage --git-ignore-branch --git-no-sign-tags -us -uc
+gbp buildpackage --git-no-sign-tags -us -uc
mkdir ../gbp-output
mv ../*1.0* ../gbp-output/.
diff --git a/tests/tests/tagupl b/tests/tests/tagupl
index c626c08..9d3e45a 100755
--- a/tests/tests/tagupl
+++ b/tests/tests/tagupl
@@ -23,12 +23,30 @@ git tag $upstreamtag
git checkout -B master quilt-tip-2
+echo foo >bar
+git add bar
+git commit -m"corrupt the upstream source to test upstream-nonidentical check"
+
t-tagupl-settings
tagname=test-dummy/$v
+t-expect-fail "the upstream source in tag $upstreamtag is not identical to the upstream source in refs/heads/master" \
+t-tagupl-test --quilt=gbp --upstream=$upstreamtag
+
+git reset --hard HEAD~1
+
+t-expect-fail "upstream tag $upstreamtag is not an ancestor of refs/heads/master" \
t-tagupl-test --quilt=gbp --upstream=$upstreamtag
+t-expect-fail "upstream tag $upstreamtag is not an ancestor of refs/heads/master" \
+t-tagupl-test --quilt=gbp --force=suite --force=no-such-force-option --upstream=$upstreamtag
+
+t-tagupl-test --quilt=gbp --force=suite --force=no-such-force-option-1 \
+ --force=upstream-nonancestor,no-such-force-option-2 \
+ --upstream=$upstreamtag
+t-pushed-good master
+
# todo: test each miss/rejection
ident=ok
@@ -62,25 +80,26 @@ with-mangled () {
perl <../basetag >../badtag-$ident -pe "$perl"
git tag -u Senatus -f -s -m "$(cat ../badtag-$ident)" "$tagname"
+ LC_MESSAGES=C \
t-tagupl-run-drs $tmp/$p
}
expect-quit () {
next-mangle "$1"
local perl=$2
- local mstring=$3
+ local mregexp=$3
with-mangled "$perl"
- grep ": $mstring" ../tagupl/overall.log
+ egrep ": $mregexp" ../tagupl/overall.log
}
expect-email () {
next-mangle "$1"
local perl=$2
- local mstring=$3
+ local mregexp=$3
with-mangled "$perl"
- grep 'Was not successful' ../sendmail.log
- grep "$mstring" ../sendmail.log
- grep ": failed, emailed" ../tagupl/overall.log
+ egrep 'Was not successful' ../sendmail.log
+ egrep "$mregexp" ../sendmail.log
+ egrep ": failed, emailed" ../tagupl/overall.log
}
raw-mangled () {
@@ -119,7 +138,7 @@ expect-email bupstag1 's/ upstream-tag=/$&:/' \
"failed command: git check-ref-format"
expect-email bupstag2 's/ upstream-tag=/$&x/' \
- "Couldn't find remote ref refs/tags/xUPSTREAM"
+ "[Cc]ouldn't find remote ref refs/tags/xUPSTREAM"
expect-email wrongver '' 'mismatch: changelog Version'
diff --git a/tests/tests/tagupl-baredebian b/tests/tests/tagupl-baredebian
new file mode 100755
index 0000000..b485abb
--- /dev/null
+++ b/tests/tests/tagupl-baredebian
@@ -0,0 +1,38 @@
+#!/bin/bash
+set -e
+. tests/lib
+. $troot/lib-baredebian
+
+t-dependencies quilt git-debpush
+
+t-debpolicy
+
+t-setup-import baredebian
+
+cd $p
+
+baredebian-test-vars
+t-tagupl-settings
+
+baredebian-test-minimum
+baredebian-test-core-prepush
+
+
+sed -i '15icorruption' debian/patches/0002-Edit-the-.c-file.patch
+git add debian/patches/0002-Edit-the-.c-file.patch
+git commit -m"corrupt a quilt patch to test the patches-applicable check"
+
+tagname=test-dummy/$v
+
+t-expect-fail "'git apply' failed to apply patch 0002-Edit-the-.c-file.patch ('patches-applicable' check)" \
+t-tagupl-test --baredebian
+
+git reset --hard HEAD~1
+
+t-tagupl-test --baredebian
+
+git branch split.p dgit/dgit/sid # we didn't generate this here
+
+baredebian-test-core-postpush
+
+t-ok
diff --git a/tests/tests/tagupl-gbp b/tests/tests/tagupl-gbp
new file mode 100755
index 0000000..a4ecb09
--- /dev/null
+++ b/tests/tests/tagupl-gbp
@@ -0,0 +1,28 @@
+#!/bin/bash
+set -e
+. tests/lib
+. $troot/lib-baredebian
+
+t-dependencies git-debpush DEBORIG
+
+t-setup-import gbp
+
+t-debpolicy
+
+cd $p
+
+git deborig
+
+t-dgit -wgf --quilt=gbp --dgit-view-save=split.b quilt-fixup
+
+t-tagupl-settings
+
+tagname=test-dummy/$v
+
+t-tagupl-test --gbp
+
+git branch split.p dgit/dgit/sid # we didn't generate this here
+
+t-gbp-pushed-good sid
+
+t-ok
diff --git a/tests/tests/tagupl-native b/tests/tests/tagupl-native
index 694d879..e8a25c7 100755
--- a/tests/tests/tagupl-native
+++ b/tests/tests/tagupl-native
@@ -25,5 +25,6 @@ git commit -m 'convert to 1.0 native'
tagname=test-dummy/$v
t-tagupl-test
+t-pushed-good master
t-ok