diff options
author | Guillem Jover <guillem@debian.org> | 2016-12-16 22:39:38 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2017-01-25 04:02:40 +0100 |
commit | 9899bdcf9bde76d969b124abf0a898fcbb202c70 (patch) | |
tree | 076ac53b737af369671d56cc865d1de8c3daa526 /scripts/t | |
parent | df630946cc239c4fb7494dd3a2b78fa4e1c98358 (diff) | |
download | dpkg-9899bdcf9bde76d969b124abf0a898fcbb202c70.tar.gz |
dpkg-source: Generate Testsuite-Restrictions fields from test restrictions
This information is currently only available in the Restrictions field in
the debian/tests/control file.
When dispatching tests, it might be inconvenient to have to download and
unpack the source package beforehand. Let's expose this via the .dsc in
a similar way we do for the Testsuite-Triggers field.
Closes: #847926
Based-on-patch-by: Iain Lane <laney@debian.org>
Diffstat (limited to 'scripts/t')
-rw-r--r-- | scripts/t/dpkg_source.t | 16 | ||||
-rw-r--r-- | scripts/t/dpkg_source/testsuite_4.dsc | 17 |
2 files changed, 32 insertions, 1 deletions
diff --git a/scripts/t/dpkg_source.t b/scripts/t/dpkg_source.t index 2de0c0dbb..317e445f0 100644 --- a/scripts/t/dpkg_source.t +++ b/scripts/t/dpkg_source.t @@ -16,7 +16,7 @@ use strict; use warnings; -use Test::More tests => 8; +use Test::More tests => 10; use Test::Dpkg qw(test_neutralize_checksums); use File::Spec::Functions qw(rel2abs); @@ -64,12 +64,20 @@ Architecture: all Description: test package TMPL_CONTROL +my $tmpl_tests_control = <<'TMPL_TESTS_CONTROL'; +Test-Command: ${test-command} +Depends: ${test-depends} +Restrictions: ${test-restrictions} +TMPL_TESTS_CONTROL + my %default_substvars = ( 'source-name' => 'test-source', 'source-version' => 0, 'source-section' => 'test', 'source-priority' => 'optional', 'source-testsuite' => 'autopkgtest', + 'test-command' => 'true', + 'test-depends' => '@', 'suite' => 'unstable', 'urgency' => 'low', 'maintainer' => 'Dpkg Developers <debian-dpkg@lists.debian.org>', @@ -168,4 +176,10 @@ $dirname = gen_source('source-name' => 'testsuite', 'source-version' => 3); test_build_source($dirname); +$dirname = gen_source('source-name' => 'testsuite', + 'source-version' => 4, + 'test-restrictions' => 'needs-root,build-needed allow-stderr', + 'control-test' => $tmpl_tests_control); +test_build_source($dirname); + 1; diff --git a/scripts/t/dpkg_source/testsuite_4.dsc b/scripts/t/dpkg_source/testsuite_4.dsc new file mode 100644 index 000000000..197cdbc76 --- /dev/null +++ b/scripts/t/dpkg_source/testsuite_4.dsc @@ -0,0 +1,17 @@ +Format: 3.0 (native) +Source: testsuite +Binary: test-binary +Architecture: all +Version: 4 +Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org> +Standards-Version: 1.0 +Testsuite: autopkgtest +Testsuite-Restrictions: allow-stderr, build-needed, needs-root +Package-List: + test-binary deb test optional arch=all +Checksums-Sha1: + 0000000000000000000000000000000000000000 0 testsuite_4.tar.xz +Checksums-Sha256: + 0000000000000000000000000000000000000000000000000000000000000000 0 testsuite_4.tar.xz +Files: + 00000000000000000000000000000000 0 testsuite_4.tar.xz |