mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-04-02 13:51:12 +00:00
autopkgtest: Make Linux -> DKMS triggering arch specific
Only trigger DKMS tests for architectures on which the given kernel actually exists.
This commit is contained in:
parent
76751fff88
commit
49260078e4
@ -186,7 +186,11 @@ class AutoPackageTest(object):
|
||||
# linux-meta* builds a "dkms" binary as well. With that we ensure that we
|
||||
# don't regress DKMS drivers with new kernel versions.
|
||||
if src.startswith('linux-meta'):
|
||||
extra_bins.append('dkms')
|
||||
# does this have any image on this arch?
|
||||
for b in srcinfo[BINARIES]:
|
||||
p, a = b.split('/', 1)
|
||||
if a == arch and '-image' in p:
|
||||
extra_bins.append('dkms')
|
||||
|
||||
# plus all direct reverse dependencies of its binaries which have
|
||||
# an autopkgtest
|
||||
@ -195,7 +199,7 @@ class AutoPackageTest(object):
|
||||
try:
|
||||
rdeps = binaries_info[binary][RDEPENDS]
|
||||
except KeyError:
|
||||
self.log_verbose('Ignoring nonexistant binary %s (FTBFS/NBS)?' % binary)
|
||||
self.log_verbose('Ignoring nonexistant binary %s on %s (FTBFS/NBS)?' % (binary, arch))
|
||||
continue
|
||||
for rdep in rdeps:
|
||||
rdep_src = binaries_info[rdep][SOURCE]
|
||||
@ -477,7 +481,7 @@ class AutoPackageTest(object):
|
||||
res.update(archinfo.keys())
|
||||
return res
|
||||
|
||||
def _trigsources(verinfo):
|
||||
def _trigsources(verinfo, arch):
|
||||
'''Calculate the triggers for a given verinfo map
|
||||
|
||||
verinfo is ver -> arch -> {(triggering-src1, ver1), ...}, i. e. an
|
||||
@ -488,12 +492,11 @@ class AutoPackageTest(object):
|
||||
kernel_triggers = set()
|
||||
nonkernel_triggers = set()
|
||||
for archinfo in verinfo.values():
|
||||
for triggers in archinfo.values():
|
||||
for (t, v) in triggers:
|
||||
if t.startswith('linux-meta'):
|
||||
kernel_triggers.add(t)
|
||||
else:
|
||||
nonkernel_triggers.add(t)
|
||||
for (t, v) in archinfo[arch]:
|
||||
if t.startswith('linux-meta'):
|
||||
kernel_triggers.add(t)
|
||||
else:
|
||||
nonkernel_triggers.add(t)
|
||||
return (kernel_triggers, nonkernel_triggers)
|
||||
|
||||
# build per-queue request strings for new test requests
|
||||
@ -508,7 +511,7 @@ class AutoPackageTest(object):
|
||||
# run just one test for all triggers; but for proposed
|
||||
# kernels we want to run a separate test for each, so that
|
||||
# the test runs under that particular kernel
|
||||
kernel_triggers, other_triggers = _trigsources(verinfo)
|
||||
kernel_triggers, other_triggers = _trigsources(verinfo, arch)
|
||||
for kt in sorted(kernel_triggers):
|
||||
params = {'triggers': [kt]}
|
||||
requests.append((pkg, json.dumps(params)))
|
||||
|
@ -405,6 +405,16 @@ lightgreen 1 i386 green 2
|
||||
})
|
||||
})
|
||||
|
||||
self.assertEqual(
|
||||
self.amqp_requests,
|
||||
set(['debci-series-i386:green {"triggers": ["green"]}',
|
||||
'debci-series-amd64:green {"triggers": ["green"]}',
|
||||
'debci-series-i386:lightgreen {"triggers": ["green"]}',
|
||||
'debci-series-amd64:lightgreen {"triggers": ["green"]}',
|
||||
'debci-series-i386:darkgreen {"triggers": ["green"]}',
|
||||
'debci-series-amd64:darkgreen {"triggers": ["green"]}',
|
||||
'debci-series-amd64:green64 {"triggers": ["green"]}']))
|
||||
|
||||
self.assertIn('green64 1 amd64', self.pending_requests)
|
||||
self.assertNotIn('green64 1 i386', self.pending_requests)
|
||||
|
||||
@ -436,6 +446,7 @@ lightgreen 1 i386 green 2
|
||||
)[0]
|
||||
|
||||
# all tests ran, there should be no more pending ones
|
||||
self.assertEqual(self.amqp_requests, set())
|
||||
self.assertEqual(self.pending_requests, '')
|
||||
|
||||
# not expecting any failures to retrieve from swift
|
||||
@ -1157,10 +1168,12 @@ lightgreen 1 i386 green 3
|
||||
|
||||
self.do_test(
|
||||
[('linux-image-generic', {'Source': 'linux-meta'}, None),
|
||||
('linux-image-grumpy-generic', {'Source': 'linux-meta-lts-grumpy'}, None)
|
||||
('linux-image-grumpy-generic', {'Source': 'linux-meta-lts-grumpy'}, None),
|
||||
('linux-image-64only', {'Source': 'linux-meta-64only', 'Architecture': 'amd64'}, None),
|
||||
],
|
||||
{'linux-meta': (False, {'fancy 1': {'amd64': 'RUNNING', 'i386': 'RUNNING'}}),
|
||||
'linux-meta-lts-grumpy': (False, {'fancy 1': {'amd64': 'RUNNING', 'i386': 'RUNNING'}})
|
||||
'linux-meta-lts-grumpy': (False, {'fancy 1': {'amd64': 'RUNNING', 'i386': 'RUNNING'}}),
|
||||
'linux-meta-64only': (False, {'fancy 1': {'amd64': 'RUNNING'}}),
|
||||
})
|
||||
|
||||
# one separate test should be triggered for each kernel
|
||||
@ -1169,10 +1182,12 @@ lightgreen 1 i386 green 3
|
||||
set(['debci-series-i386:fancy {"triggers": ["linux-meta"]}',
|
||||
'debci-series-amd64:fancy {"triggers": ["linux-meta"]}',
|
||||
'debci-series-i386:fancy {"triggers": ["linux-meta-lts-grumpy"]}',
|
||||
'debci-series-amd64:fancy {"triggers": ["linux-meta-lts-grumpy"]}']))
|
||||
'debci-series-amd64:fancy {"triggers": ["linux-meta-lts-grumpy"]}',
|
||||
'debci-series-amd64:fancy {"triggers": ["linux-meta-64only"]}']))
|
||||
|
||||
# ... and that they get recorded as pending
|
||||
expected_pending = '''fancy 1 amd64 linux-meta 1
|
||||
fancy 1 amd64 linux-meta-64only 1
|
||||
fancy 1 amd64 linux-meta-lts-grumpy 1
|
||||
fancy 1 i386 linux-meta 1
|
||||
fancy 1 i386 linux-meta-lts-grumpy 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user