Autopkgtest: Use correct Swift container for ADT_PPAS

When using ADT_PPAS, the results won't go into the "autopkgtest-%SERIES"
container but into the PPA specific "autopkgtest-%SERIES-LPUSER-PPANAME" one.
bzr-import-20160707
Martin Pitt 9 years ago
parent 6d0c3a1fa6
commit 123eb43320

@ -321,7 +321,10 @@ class AutoPackageTest(object):
query['marker'] = query['prefix'] + latest_run_id
# request new results from swift
url = os.path.join(swift_url, 'autopkgtest-' + self.series)
container = 'autopkgtest-' + self.series
if self.britney.options.adt_ppas:
container += '-' + self.britney.options.adt_ppas[-1].replace('/', '-')
url = os.path.join(swift_url, container)
url += '?' + urllib.parse.urlencode(query)
try:
f = urlopen(url)
@ -341,7 +344,7 @@ class AutoPackageTest(object):
for p in result_paths:
self.fetch_one_result(
os.path.join(swift_url, 'autopkgtest-' + self.series, p, 'result.tar'), src, arch)
os.path.join(swift_url, container, p, 'result.tar'), src, arch)
fetch_swift_results._done = set()

@ -69,8 +69,8 @@ ADT_ARCHES = amd64 i386 armhf ppc64el
ADT_AMQP = amqp://test_request:password@162.213.33.228
# Swift base URL with the results (must be publicly readable and browsable)
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
# space separate list of PPAs to add for test requests and for polling results;
# the *last* one determines the swift container name
ADT_PPAS =
BOOTTEST_ENABLE = no

@ -1562,6 +1562,20 @@ class T(TestBase):
'debci-series-%s:lightgreen {"ppas": ["joe/foo", "awesome-developers/staging"], "triggers": ["lightgreen/2"]}' % arch in self.amqp_requests)
self.assertEqual(len(self.amqp_requests), 2)
# add results to PPA specific swift container
self.swift.set_results({'autopkgtest-series-awesome-developers-staging': {
'series/i386/l/lightgreen/20150101_100100@': (0, 'lightgreen 2', tr('lightgreen/2')),
'series/amd64/l/lightgreen/20150101_100101@': (0, 'lightgreen 2', tr('lightgreen/2')),
}})
self.do_test(
[],
{'lightgreen': (True, {'lightgreen 2': {'i386': 'PASS', 'amd64': 'PASS'}})},
{'lightgreen': [('old-version', '1'), ('new-version', '2')]}
)
self.assertEqual(self.amqp_requests, set())
self.assertEqual(self.pending_requests, {})
if __name__ == '__main__':
unittest.main()

Loading…
Cancel
Save