mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-06-15 19:51:55 +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
|
# linux-meta* builds a "dkms" binary as well. With that we ensure that we
|
||||||
# don't regress DKMS drivers with new kernel versions.
|
# don't regress DKMS drivers with new kernel versions.
|
||||||
if src.startswith('linux-meta'):
|
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
|
# plus all direct reverse dependencies of its binaries which have
|
||||||
# an autopkgtest
|
# an autopkgtest
|
||||||
@ -195,7 +199,7 @@ class AutoPackageTest(object):
|
|||||||
try:
|
try:
|
||||||
rdeps = binaries_info[binary][RDEPENDS]
|
rdeps = binaries_info[binary][RDEPENDS]
|
||||||
except KeyError:
|
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
|
continue
|
||||||
for rdep in rdeps:
|
for rdep in rdeps:
|
||||||
rdep_src = binaries_info[rdep][SOURCE]
|
rdep_src = binaries_info[rdep][SOURCE]
|
||||||
@ -477,7 +481,7 @@ class AutoPackageTest(object):
|
|||||||
res.update(archinfo.keys())
|
res.update(archinfo.keys())
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def _trigsources(verinfo):
|
def _trigsources(verinfo, arch):
|
||||||
'''Calculate the triggers for a given verinfo map
|
'''Calculate the triggers for a given verinfo map
|
||||||
|
|
||||||
verinfo is ver -> arch -> {(triggering-src1, ver1), ...}, i. e. an
|
verinfo is ver -> arch -> {(triggering-src1, ver1), ...}, i. e. an
|
||||||
@ -488,12 +492,11 @@ class AutoPackageTest(object):
|
|||||||
kernel_triggers = set()
|
kernel_triggers = set()
|
||||||
nonkernel_triggers = set()
|
nonkernel_triggers = set()
|
||||||
for archinfo in verinfo.values():
|
for archinfo in verinfo.values():
|
||||||
for triggers in archinfo.values():
|
for (t, v) in archinfo[arch]:
|
||||||
for (t, v) in triggers:
|
if t.startswith('linux-meta'):
|
||||||
if t.startswith('linux-meta'):
|
kernel_triggers.add(t)
|
||||||
kernel_triggers.add(t)
|
else:
|
||||||
else:
|
nonkernel_triggers.add(t)
|
||||||
nonkernel_triggers.add(t)
|
|
||||||
return (kernel_triggers, nonkernel_triggers)
|
return (kernel_triggers, nonkernel_triggers)
|
||||||
|
|
||||||
# build per-queue request strings for new test requests
|
# 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
|
# run just one test for all triggers; but for proposed
|
||||||
# kernels we want to run a separate test for each, so that
|
# kernels we want to run a separate test for each, so that
|
||||||
# the test runs under that particular kernel
|
# 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):
|
for kt in sorted(kernel_triggers):
|
||||||
params = {'triggers': [kt]}
|
params = {'triggers': [kt]}
|
||||||
requests.append((pkg, json.dumps(params)))
|
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.assertIn('green64 1 amd64', self.pending_requests)
|
||||||
self.assertNotIn('green64 1 i386', self.pending_requests)
|
self.assertNotIn('green64 1 i386', self.pending_requests)
|
||||||
|
|
||||||
@ -436,6 +446,7 @@ lightgreen 1 i386 green 2
|
|||||||
)[0]
|
)[0]
|
||||||
|
|
||||||
# all tests ran, there should be no more pending ones
|
# all tests ran, there should be no more pending ones
|
||||||
|
self.assertEqual(self.amqp_requests, set())
|
||||||
self.assertEqual(self.pending_requests, '')
|
self.assertEqual(self.pending_requests, '')
|
||||||
|
|
||||||
# not expecting any failures to retrieve from swift
|
# not expecting any failures to retrieve from swift
|
||||||
@ -1157,10 +1168,12 @@ lightgreen 1 i386 green 3
|
|||||||
|
|
||||||
self.do_test(
|
self.do_test(
|
||||||
[('linux-image-generic', {'Source': 'linux-meta'}, None),
|
[('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': (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
|
# 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"]}',
|
set(['debci-series-i386:fancy {"triggers": ["linux-meta"]}',
|
||||||
'debci-series-amd64:fancy {"triggers": ["linux-meta"]}',
|
'debci-series-amd64:fancy {"triggers": ["linux-meta"]}',
|
||||||
'debci-series-i386:fancy {"triggers": ["linux-meta-lts-grumpy"]}',
|
'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
|
# ... and that they get recorded as pending
|
||||||
expected_pending = '''fancy 1 amd64 linux-meta 1
|
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 amd64 linux-meta-lts-grumpy 1
|
||||||
fancy 1 i386 linux-meta 1
|
fancy 1 i386 linux-meta 1
|
||||||
fancy 1 i386 linux-meta-lts-grumpy 1
|
fancy 1 i386 linux-meta-lts-grumpy 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user