chiark / gitweb /
Test suite: orig-include-exclude-chkquery: New test
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 23 Oct 2016 00:40:35 +0000 (01:40 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 30 Oct 2016 19:50:47 +0000 (19:50 +0000)
Check that we make the right file_in_archive ftpmaster API queries.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/tests/control
tests/tests/orig-include-exclude-chkquery [new file with mode: 0755]

index f1bdef1..c672e53 100644 (file)
@@ -21,7 +21,7 @@ Tests-Directory: tests/tests
 Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8)
 Restrictions: x-dgit-git-only
 
-Tests: absurd-gitapply build-modes build-modes-asplit build-modes-gbp-asplit clone-clogsigpipe 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 gitconfig import-native import-nonnative inarchivecopy mismatches-contents mismatches-dscchanges newtag-clone-nogit oldnewtagalt oldtag-clone-nogit orig-include-exclude overwrite-chkclog overwrite-junk overwrite-splitbrains 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 unrepresentable version-opt
+Tests: absurd-gitapply build-modes build-modes-asplit build-modes-gbp-asplit clone-clogsigpipe 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 gitconfig import-native import-nonnative inarchivecopy mismatches-contents mismatches-dscchanges newtag-clone-nogit oldnewtagalt oldtag-clone-nogit orig-include-exclude orig-include-exclude-chkquery overwrite-chkclog overwrite-junk overwrite-splitbrains 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 unrepresentable version-opt
 Tests-Directory: tests/tests
 Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8)
 
diff --git a/tests/tests/orig-include-exclude-chkquery b/tests/tests/orig-include-exclude-chkquery
new file mode 100755 (executable)
index 0000000..59fc80f
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+t-git-config dgit-distro.test-dummy.archive-query ftpmasterapi:
+# ^ that will crash if it gets unexpected file_in_archive queries
+
+# orig-include-exclude will set origs and usvsns
+update-files_in_archive () {
+       for o in $origs; do for usvsn in $usvsns; do \
+               of=${p}_${v%-*}.${o}.tar.gz
+               pat="%/${of//_/\\_}"
+               # curl url-decodes these things so we have to have literals
+               find $tmp/mirror -name $of | \
+                       xargs -r sha256sum | \
+                       perl -pe '
+                               BEGIN { print "["; }
+                               chomp;
+                               s/^/{"sha256sum":"/;
+                               s/  /","filename":"/;
+                               s/$/"}$delim/;
+                               $delim=",";
+                               END { print "]\n"; }
+                       ' \
+                       >$tmp/aq/"file_in_archive/$pat"
+       done; done
+}
+
+test_push_2_hook=update-files_in_archive
+
+. $troot/lib-orig-include-exclude
+
+echo done.