chiark / gitweb /
Test suite: mismatch: New test
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 9 Oct 2016 12:57:28 +0000 (13:57 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 10 Oct 2016 00:01:11 +0000 (01:01 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/tests/control
tests/tests/mismatches [new file with mode: 0755]

index f2f36aa31f2e022a690f2dc72c7ed3c109ef001a..8ff52ae8e9409930ae5dcedc356bdc5d1fa6c471 100644 (file)
@@ -21,7 +21,7 @@ Tests-Directory: tests/tests
 Depends: dgit, dgit-infrastructure, devscripts
 Restrictions: x-dgit-git-only
 
-Tests: build-modes build-modes-asplit build-modes-gbp-asplit clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp distropatches-reject drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast import-native import-nonnative inarchivecopy newtag-clone-nogit oldnewtagalt oldtag-clone-nogit overwrite-chkclog overwrite-version push-buildproductsdir push-newpackage push-nextdgit quilt quilt-gbp quilt-gbp-build-modes quilt-singlepatch quilt-splitbrains rpush tag-updates test-list-uptodate trustingpolicy-replay version-opt
+Tests: build-modes build-modes-asplit build-modes-gbp-asplit clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp distropatches-reject drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast import-native import-nonnative inarchivecopy mismatches newtag-clone-nogit oldnewtagalt oldtag-clone-nogit overwrite-chkclog overwrite-version push-buildproductsdir push-newpackage push-nextdgit quilt quilt-gbp quilt-gbp-build-modes quilt-singlepatch quilt-splitbrains rpush tag-updates test-list-uptodate trustingpolicy-replay version-opt
 Tests-Directory: tests/tests
 Depends: dgit, dgit-infrastructure, devscripts
 
diff --git a/tests/tests/mismatches b/tests/tests/mismatches
new file mode 100755 (executable)
index 0000000..9bb554e
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+t-tstunt-parsechangelog
+
+t-prep-newpackage example 1.0
+
+cd $p
+revision=1
+
+check () {
+       local fext=$1
+       local emsgpat=$2
+
+       t-dgit -wgf build-source
+
+       perl -i~ -pe 's/^ ([0-9a-f])/ sprintf " %x", (hex $1)^1 /e' \
+               ../*.$fext
+
+       t-expect-fail "$emsgpat" \
+       t-dgit -wgf push --new
+}
+
+check dsc E:'dpkg-source.*error.*checksum'
+check changes E:'dgit.*hash or size.*varies'
+
+# and finally check that our test is basically working
+
+t-dgit -wgf build-source
+
+t-dgit -wgf push --new
+
+echo ok.