Run autopkgtests for DKMS packages

They are being tested through autodep8.
bzr-import-20160707
Martin Pitt 10 years ago
parent a6bbfa6989
commit 027404b6e7

@ -34,7 +34,7 @@ from urllib import urlencode, urlopen
import apt_pkg import apt_pkg
import kombu import kombu
from consts import (AUTOPKGTEST, BINARIES, RDEPENDS, SOURCE, VERSION) from consts import (AUTOPKGTEST, BINARIES, DEPENDS, RDEPENDS, SOURCE, VERSION)
adt_britney = os.path.expanduser("~/auto-package-testing/jenkins/adt-britney") adt_britney = os.path.expanduser("~/auto-package-testing/jenkins/adt-britney")
@ -131,6 +131,22 @@ class AutoPackageTest(object):
def log_error(self, msg): def log_error(self, msg):
print('E: [%s] - %s' % (time.asctime(), msg)) print('E: [%s] - %s' % (time.asctime(), msg))
def has_autodep8(self, srcinfo):
'''Check if package is covered by autodep8
srcinfo is an item from self.britney.sources
'''
# DKMS: some binary depends on "dkms"
for bin_arch in srcinfo[BINARIES]:
binpkg = bin_arch.split('/')[0] # chop off arch
try:
bininfo = self.britney.binaries['unstable']['amd64'][0][binpkg]
except KeyError:
continue
if 'dkms' in (bininfo[DEPENDS] or ''):
return True
return False
def tests_for_source(self, src, ver): def tests_for_source(self, src, ver):
'''Iterate over all tests that should be run for given source''' '''Iterate over all tests that should be run for given source'''
@ -146,7 +162,7 @@ class AutoPackageTest(object):
srcinfo = sources_info[src] srcinfo = sources_info[src]
# we want to test the package itself, if it still has a test in # we want to test the package itself, if it still has a test in
# unstable # unstable
if srcinfo[AUTOPKGTEST]: if srcinfo[AUTOPKGTEST] or self.has_autodep8(srcinfo):
reported_pkgs.add(src) reported_pkgs.add(src)
tests.append((src, ver)) tests.append((src, ver))
@ -161,7 +177,8 @@ class AutoPackageTest(object):
continue continue
for rdep in rdeps: for rdep in rdeps:
rdep_src = binaries_info[rdep][SOURCE] rdep_src = binaries_info[rdep][SOURCE]
if sources_info[rdep_src][AUTOPKGTEST]: rdep_src_info = sources_info[rdep_src]
if rdep_src_info[AUTOPKGTEST] or self.has_autodep8(rdep_src_info):
if rdep_src not in reported_pkgs: if rdep_src not in reported_pkgs:
# we don't care about the version of rdep # we don't care about the version of rdep
tests.append((rdep_src, sources_info[rdep_src][VERSION])) tests.append((rdep_src, sources_info[rdep_src][VERSION]))

@ -610,6 +610,20 @@ lightgreen 1 i386 green 3
r'autopkgtest for lightgreen 2: .*amd64.*in progress.*i386.*in progress', r'autopkgtest for lightgreen 2: .*amd64.*in progress.*i386.*in progress',
r'autopkgtest for rainbow 1: .*amd64.*in progress.*i386.*in progress']) r'autopkgtest for rainbow 1: .*amd64.*in progress.*i386.*in progress'])
def test_dkms(self):
'''DKMS packages are autopkgtested (via autodep8)'''
self.data.add('dkms', False, {})
self.data.add('fancy-dkms', False, {'Source': 'fancy', 'Depends': 'dkms (>= 1)'})
self.do_test(
[('dkms', {'Version': '2'}, None)],
# FIXME: while we only submit requests through AMQP, but don't consider
# their results, we don't expect this to hold back stuff.
VALID_CANDIDATE,
[r'\bdkms\b.*>1</a> to .*>2<',
r'autopkgtest for fancy 1: .*amd64.*in progress.*i386.*in progress'])
def test_no_amqp_config(self): def test_no_amqp_config(self):
'''Run without autopkgtest requests''' '''Run without autopkgtest requests'''

Loading…
Cancel
Save