summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2016-05-27 10:04:26 +0200
committerGuido Günther <agx@sigxcpu.org>2016-05-27 10:04:26 +0200
commitcfcac022a68d7157f5db8a9d0c77e72bcc6c6ff5 (patch)
tree3d69cc319533a6c9be742aff57b24aed44d742d2 /tests
parent0a99f3f8e484260fa7ef2e14ee881e9ad4bf0f84 (diff)
buildpackage: Allow to generate subtarballs
This does not support pristine-tar yet.
Diffstat (limited to 'tests')
-rw-r--r--tests/component/deb/test_buildpackage.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/component/deb/test_buildpackage.py b/tests/component/deb/test_buildpackage.py
index 7b280a2f..edfe1ddc 100644
--- a/tests/component/deb/test_buildpackage.py
+++ b/tests/component/deb/test_buildpackage.py
@@ -104,3 +104,26 @@ class TestBuildpackage(ComponentTestBase):
self.check_hook_vars('posttag', ["GBP_TAG",
"GBP_BRANCH",
"GBP_SHA1"])
+
+ def test_subtarball_generation(self):
+ """Test that generating tarball and additional tarball works"""
+ def _dsc(version):
+ return os.path.join(DEB_TEST_DATA_DIR,
+ 'dsc-3.0-additional-tarballs',
+ 'hello-debhelper_%s.dsc' % version)
+ dsc = _dsc('2.8-1')
+ tarballs = ["../hello-debhelper_2.8.orig-foo.tar.gz",
+ "../hello-debhelper_2.8.orig.tar.gz"]
+
+ assert import_dsc(['arg0', dsc]) == 0
+ os.chdir('hello-debhelper')
+ for t in tarballs:
+ self.assertFalse(os.path.exists(t), "Tarball %s must not exist" % t)
+ ret = buildpackage(['arg0',
+ '--git-subtarball=foo',
+ '--git-posttag=printenv > posttag.out',
+ '--git-builder=touch builder-run.stamp',
+ '--git-cleaner=/bin/true'])
+ ok_(ret == 0, "Building the package failed")
+ for t in tarballs:
+ self.assertTrue(os.path.exists(t), "Tarball %s not found" % t)