aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/component
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-01-11 11:57:37 +0100
committerGuido Günther <agx@sigxcpu.org>2017-01-11 15:23:50 +0100
commit80a1c39abf60d09bb6b8e033350b06ac789726cf (patch)
treee52e6d2c779ba167bdbef3b01209c9e49cdaafb0 /tests/component
parent67d8b9f44b089eb04ae4ce54c03a0e06d751de30 (diff)
Quote arguments passed to builder
Closes: #850869 Thanks: Simon McVittie
Diffstat (limited to 'tests/component')
-rw-r--r--tests/component/deb/test_buildpackage.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/component/deb/test_buildpackage.py b/tests/component/deb/test_buildpackage.py
index 822f2009..2e4cef68 100644
--- a/tests/component/deb/test_buildpackage.py
+++ b/tests/component/deb/test_buildpackage.py
@@ -150,3 +150,24 @@ class TestBuildpackage(ComponentTestBase):
['--git-export-dir=../foo/bar'],
)
ok_(os.path.exists('../foo/bar'))
+
+ def test_argument_quoting(self):
+ """Test that we quote arguments to builder (#)"""
+ def _dsc(version):
+ return os.path.join(DEB_TEST_DATA_DIR,
+ 'dsc-native',
+ 'git-buildpackage_%s.dsc' % version)
+
+ dsc = _dsc('0.4.14')
+ assert import_dsc(['arg0', dsc]) == 0
+ os.chdir('git-buildpackage')
+ with open('../arg with spaces', 'w'):
+ pass
+ # We use ls as builder to look for a file with spaces. This
+ # will fail if build arguments are not properly quoted and
+ # therefore split up
+ ret = buildpackage(['arg0',
+ '--git-builder=ls',
+ '--git-cleaner=/bin/true',
+ '../arg with spaces'])
+ ok_(ret == 0, "Building the package failed")