Add ADT_PPAS option for adding PPAs to autopkgtest requests

For using britney on PPAs we need to add the "ppas" test parameter to AMQP
autopkgtest requests. Add ADT_PPAS britney.conf option which gets passed
through to test requests.
bzr-import-20160707
Martin Pitt 9 years ago
parent 2ebfc0bb8f
commit 400f4087bb

@ -558,6 +558,8 @@ class AutoPackageTest(object):
triggers = _trigsources(verinfo, arch) triggers = _trigsources(verinfo, arch)
for t in sorted(triggers): for t in sorted(triggers):
params = {'triggers': [t]} params = {'triggers': [t]}
if self.britney.options.adt_ppas:
params['ppas'] = self.britney.options.adt_ppas
requests.append((pkg, json.dumps(params))) requests.append((pkg, json.dumps(params)))
arch_queues[arch] = ('debci-%s-%s' % (self.series, arch), requests) arch_queues[arch] = ('debci-%s-%s' % (self.series, arch), requests)

@ -69,6 +69,9 @@ ADT_ARCHES = amd64 i386 armhf ppc64el
ADT_AMQP = amqp://test_request:password@162.213.33.228 ADT_AMQP = amqp://test_request:password@162.213.33.228
# Swift base URL with the results (must be publicly readable and browsable) # Swift base URL with the results (must be publicly readable and browsable)
ADT_SWIFT_URL = https://objectstorage.prodstack4-5.canonical.com/v1/AUTH_77e2ada1e7a84929a74ba3b87153c0ac ADT_SWIFT_URL = https://objectstorage.prodstack4-5.canonical.com/v1/AUTH_77e2ada1e7a84929a74ba3b87153c0ac
# space separate list of PPAs to add for test requests; the *last* one
# determines the swift container name
ADT_PPAS =
BOOTTEST_ENABLE = no BOOTTEST_ENABLE = no
BOOTTEST_DEBUG = yes BOOTTEST_DEBUG = yes

@ -479,6 +479,7 @@ class Britney(object):
else: else:
self.__log("Ignoring ADT_ARCHES %s as it is not in architectures list" % arch) self.__log("Ignoring ADT_ARCHES %s as it is not in architectures list" % arch)
self.options.adt_arches = adt_arches self.options.adt_arches = adt_arches
self.options.adt_ppas = self.options.adt_ppas.strip().split()
def __log(self, msg, type="I"): def __log(self, msg, type="I"):
"""Print info messages according to verbosity level """Print info messages according to verbosity level

@ -1209,26 +1209,6 @@ lightgreen 1 i386 green 3
{'lightgreen': [('old-version', '1'), ('new-version', '2')]} {'lightgreen': [('old-version', '1'), ('new-version', '2')]}
) )
def test_disable_adt(self):
'''Run without autopkgtest requests'''
# Disable AMQP server config, to ensure we don't touch them with ADT
# disabled
for line in fileinput.input(self.britney_conf, inplace=True):
if line.startswith('ADT_ENABLE'):
print('ADT_ENABLE = no')
elif not line.startswith('ADT_AMQP') and not line.startswith('ADT_SWIFT_URL'):
sys.stdout.write(line)
exc = self.do_test(
[('libgreen1', {'Version': '2', 'Source': 'green', 'Depends': 'libc6'}, 'autopkgtest')],
{'green': (True, {})},
{'green': [('old-version', '1'), ('new-version', '2')]})[1]
self.assertNotIn('autopkgtest', exc['green']['tests'])
self.assertEqual(self.amqp_requests, set())
self.assertEqual(self.pending_requests, None)
################################################################ ################################################################
# Tests for hint processing # Tests for hint processing
################################################################ ################################################################
@ -1565,6 +1545,50 @@ fancy 1 i386 linux-meta-lts-grumpy 1
{'gcc-snapshot': (True, {})})[1] {'gcc-snapshot': (True, {})})[1]
self.assertNotIn('autopkgtest', exc['gcc-snapshot']['tests']) self.assertNotIn('autopkgtest', exc['gcc-snapshot']['tests'])
################################################################
# Tests for non-default ADT_* configuration modes
################################################################
def test_disable_adt(self):
'''Run without autopkgtest requests'''
# Disable AMQP server config, to ensure we don't touch them with ADT
# disabled
for line in fileinput.input(self.britney_conf, inplace=True):
if line.startswith('ADT_ENABLE'):
print('ADT_ENABLE = no')
elif not line.startswith('ADT_AMQP') and not line.startswith('ADT_SWIFT_URL'):
sys.stdout.write(line)
exc = self.do_test(
[('libgreen1', {'Version': '2', 'Source': 'green', 'Depends': 'libc6'}, 'autopkgtest')],
{'green': (True, {})},
{'green': [('old-version', '1'), ('new-version', '2')]})[1]
self.assertNotIn('autopkgtest', exc['green']['tests'])
self.assertEqual(self.amqp_requests, set())
self.assertEqual(self.pending_requests, None)
def test_ppas(self):
'''Run test requests with additional PPAs'''
for line in fileinput.input(self.britney_conf, inplace=True):
if line.startswith('ADT_PPAS'):
print('ADT_PPAS = joe/foo awesome-developers/staging')
else:
sys.stdout.write(line)
self.do_test(
[('lightgreen', {'Version': '2'}, 'autopkgtest')],
{'lightgreen': (True, {'lightgreen 2': {'amd64': 'RUNNING-ALWAYSFAILED'}})},
{'lightgreen': [('old-version', '1'), ('new-version', '2')]}
)
self.assertEqual(
self.amqp_requests,
set(['debci-series-amd64:lightgreen {"triggers": ["lightgreen/2"], "ppas": ["joe/foo", "awesome-developers/staging"]}',
'debci-series-i386:lightgreen {"triggers": ["lightgreen/2"], "ppas": ["joe/foo", "awesome-developers/staging"]}']))
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()

Loading…
Cancel
Save