chiark / gitweb /
test suite: tagupl: New test case for new dgit-repos-server mode
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 5 Jul 2019 16:25:22 +0000 (17:25 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 6 Jul 2019 20:12:44 +0000 (21:12 +0100)
Currently we hand-synthesise a suitable tag.

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

index 2b495accf219fda8f06ae36e972f45d0b34f64fc..b3e1b325bd582a2526807e84c11dc254a1414791 100644 (file)
@@ -64,6 +64,10 @@ Tests-Directory: tests/tests
 Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime
 Restrictions: x-dgit-git-only
 
 Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime
 Restrictions: x-dgit-git-only
 
+Tests: tagupl
+Tests-Directory: tests/tests
+Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime, libdpkg-perl, libgit-wrapper-perl, liblist-compare-perl, libstring-shellquote-perl, libtry-tiny-perl
+
 Tests: test-list-uptodate
 Tests-Directory: tests/tests
 Depends: git
 Tests: test-list-uptodate
 Tests-Directory: tests/tests
 Depends: git
diff --git a/tests/tests/tagupl b/tests/tests/tagupl
new file mode 100755 (executable)
index 0000000..8e0fc8d
--- /dev/null
@@ -0,0 +1,60 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+t-dependencies DEBORIG
+
+t-debpolicy
+
+t-archive-none example
+t-git-none
+t-worktree 1.0
+
+v=1.0-1
+
+cd $p
+git checkout --orphan upstream quilt-tip-2
+git rm -rf debian
+git commit -m 'pseudo-upstream'
+git tag upstream/1.0
+
+git checkout -B master quilt-tip-2
+
+#git-deborig
+#t-dgit --quilt=gbp --dgit-view-save=split.b1 push-source --new --overwrite
+#xxx
+
+upstream=$(git rev-parse upstream/1.0~0)
+
+tagmessage="example release 1.0-1 for unstable
+
+wibble wibble
+
+[dgit distro=test-dummy split --quilt=gbp]
+[dgit please-upload upstream-tag=upstream/1.0 upstream=$upstream]"
+
+tagname=test-dummy/$v
+
+git tag -u Senatus  -s -m "$tagmessage" $tagname
+
+cd ..
+mkdir tagupl
+cd tagupl
+
+export DGIT_DRS_EMAIL_NOREPLY=noreply@example.org
+export DGIT_DRS_SENDMAIL=$troot/tstunt/sendmail
+export DGIT_DRS_DGIT=$troot/tstunt/dgit
+t-chain-test-somehow
+
+DGIT_DRS_ANY_URL=1 \
+DGIT_DRS_MODE="tag2upload $tmp/$p $tagname" \
+ $troot/drs-git-ext 
+
+# todo: test each miss/rejection
+
+cd $tmp/$p
+
+t-dgit fetch
+t-pushed-good master
+
+t-ok