diff --git a/britney.py b/britney.py index becd35c..c35cb16 100755 --- a/britney.py +++ b/britney.py @@ -564,6 +564,7 @@ class Britney(object): [], get_field('Maintainer'), False, + get_field('Testsuite', '').startswith('autopkgtest'), ] return sources diff --git a/consts.py b/consts.py index c72bb8b..493a538 100644 --- a/consts.py +++ b/consts.py @@ -24,6 +24,7 @@ SECTION = 1 BINARIES = 2 MAINTAINER = 3 FAKESRC = 4 +AUTOPKGTEST = 5 # binary package SOURCE = 2 diff --git a/tests/__init__.py b/tests/__init__.py index 81c0316..07eb564 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -63,7 +63,7 @@ class TestData: def __del__(self): shutil.rmtree(self.path) - def add(self, name, unstable, fields={}, add_src=True): + def add(self, name, unstable, fields={}, add_src=True, testsuite=None): '''Add a binary package to the index file. You need to specify at least the package name and in which list to put @@ -73,7 +73,8 @@ class TestData: fields. Unless add_src is set to False, this will also automatically create a - source record, based on fields['Source'] and name. + source record, based on fields['Source'] and name. In that case, the + "Testsuite:" field is set to the testsuite argument. ''' assert (name not in self.added_binaries[unstable]) self.added_binaries[unstable].add(name) @@ -93,8 +94,11 @@ class TestData: if add_src: src = fields.get('Source', name) if src not in self.added_sources[unstable]: - self.add_src(src, unstable, {'Version': fields['Version'], - 'Section': fields['Section']}) + srcfields = {'Version': fields['Version'], + 'Section': fields['Section']} + if testsuite: + srcfields['Testsuite'] = testsuite + self.add_src(src, unstable, srcfields) def add_src(self, name, unstable, fields={}): '''Add a source package to the index file. @@ -102,7 +106,8 @@ class TestData: You need to specify at least the package name and in which list to put it (unstable==True for unstable/proposed, or False for testing/release). fields specifies all additional entries, which can be - Version (default: 1), Section (default: devel), and Extra-Source-Only. + Version (default: 1), Section (default: devel), Testsuite (default: + none), and Extra-Source-Only. ''' assert (name not in self.added_sources[unstable]) self.added_sources[unstable].add(name)