From 2ba7fd223c617f233107db96179530b99daf4aba Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Wed, 23 Sep 2015 15:35:37 +0200 Subject: [PATCH] Autopkgtest: Trigger LXC from linux only on valid architectures If the linux source package does not build any binaries on the given architecture, don't trigger an LXC test for it. --- autopkgtest.py | 15 ++++++++++----- tests/test_autopkgtest.py | 15 +++++++++++++-- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/autopkgtest.py b/autopkgtest.py index 044c955..d503ba2 100644 --- a/autopkgtest.py +++ b/autopkgtest.py @@ -222,11 +222,16 @@ class AutoPackageTest(object): # Hardcode linux → lxc trigger until we get a more flexible # implementation: https://bugs.debian.org/779559 if src.startswith('linux-meta') and 'lxc' not in reported_pkgs: - try: - tests.append(('lxc', self.britney.sources['testing']['lxc'][VERSION])) - except KeyError: - # no lxc package in that series? *shrug*, then not - pass + # 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: + try: + tests.append(('lxc', self.britney.sources['testing']['lxc'][VERSION])) + except KeyError: + # no lxc package in that series? *shrug*, then not + pass + break tests.sort(key=lambda s_v: s_v[0]) return tests diff --git a/tests/test_autopkgtest.py b/tests/test_autopkgtest.py index f43e8dc..f72d360 100755 --- a/tests/test_autopkgtest.py +++ b/tests/test_autopkgtest.py @@ -1310,8 +1310,19 @@ fancy 1 i386 linux-meta-lts-grumpy 1 testsuite='autopkgtest') self.do_test( - [('linux-generic', {'Source': 'linux-meta'}, None)], - {'linux-meta': (False, {'lxc 1': {'amd64': 'RUNNING', 'i386': 'RUNNING'}})}) + [('linux-image', {'Source': 'linux-meta'}, None), + ('linux-image-64only', {'Source': 'linux-meta-64only', 'Architecture': 'amd64'}, None), + ], + {'linux-meta': (False, {'lxc 1': {'amd64': 'RUNNING', 'i386': 'RUNNING'}}), + 'linux-meta-64only': (False, {'lxc 1': {'amd64': 'RUNNING'}}) + }) + + self.assertEqual( + self.amqp_requests, + set(['debci-series-i386:lxc {"triggers": ["linux-meta/1"]}', + 'debci-series-amd64:lxc {"triggers": ["linux-meta/1"]}', + 'debci-series-amd64:lxc {"triggers": ["linux-meta-64only/1"]}'])) + def test_gcc(self): '''gcc only triggers some key packages'''