summaryrefslogtreecommitdiff
path: root/tests/tests
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2018-07-27 14:30:13 +0800
committerSean Whitton <spwhitton@spwhitton.name>2018-07-28 18:18:52 +0800
commite1d8c5971e9506c4bf8cdba37a1b7e69a494260e (patch)
tree37655402af645aaaf6ab9e5f38ed61c33d2eb8f2 /tests/tests
parente7f59af8133f6e80a4a18b171664af8517555360 (diff)
test suite: add stubbed test for pbuilder subcommand
pbuilder requires root, but we want to be able to test the subcommand outside of autopkgtest too. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'tests/tests')
-rwxr-xr-xtests/tests/pbuilder42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/tests/pbuilder b/tests/tests/pbuilder
new file mode 100755
index 0000000..2c9dbae
--- /dev/null
+++ b/tests/tests/pbuilder
@@ -0,0 +1,42 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+suitespecs+=' stable'
+
+t-buildproductsdir-config
+
+t-prep-newpackage example 1.0
+
+cd $p
+
+t-commit "make a commit" 1.1 stable
+
+t-tstunt pbuilder
+
+t-expect-fail "dgit: error: you asked for a builder but your debbuildopts didn't ask for any binaries -- is this really what you meant?" \
+t-dgit -v0 --pbuilder="$troot/pretend-pbuilder" pbuilder -S
+
+t-expect-fail "dgit: error: we must build a .dsc to pass to the builder but your debbuiltopts forbids the building of a source package; cannot continue" \
+t-dgit -v0 --pbuilder="$troot/pretend-pbuilder" pbuilder -b
+
+# it would be nice to try passing -g on the end of the following line
+# to confirm it gets massaged into -A, but the example package is
+# RC-buggy in that it doesn't build with -A ..
+t-dgit -v0 --pbuilder="$troot/pretend-pbuilder" pbuilder
+
+t-dgit -wgf push --new
+
+t-pushed-good master stable
+t-pushed-good-check-changes
+
+# check we actually built binaries
+t-push-included example_1.1_all.deb
+
+# this purpose of this is to check that the _source.changes that was
+# merged is the one that dgit made, not something pbuilder made (this
+# works because the -v$v in the above is handled by dgit and not
+# passed on to pbuilder)
+grep -F "example (1.0)" $changes_filename
+
+t-ok