tests: Update for recent changes

ubuntu/rebased
Paul Gevers 7 years ago
parent d59538a514
commit d6f713b8a1
No known key found for this signature in database
GPG Key ID: 9C5C99EB05BD750A

@ -211,12 +211,17 @@ class TestData:
assert (name not in self.added_binaries[unstable]) assert (name not in self.added_binaries[unstable])
self.added_binaries[unstable].add(name) self.added_binaries[unstable].add(name)
fields.setdefault('Architecture', 'all') fields.setdefault('Architecture', 'any')
fields.setdefault('Version', '1') fields.setdefault('Version', '1')
fields.setdefault('Priority', 'optional') fields.setdefault('Priority', 'optional')
fields.setdefault('Section', 'devel') fields.setdefault('Section', 'devel')
fields.setdefault('Description', 'test pkg') fields.setdefault('Description', 'test pkg')
if fields['Architecture'] == 'all': if fields['Architecture'] == 'any':
fields_local_copy = fields.copy()
for a in architectures:
fields_local_copy['Architecture'] = a
self._append(name, unstable, 'Packages_' + a, fields_local_copy)
elif fields['Architecture'] == 'all':
for a in architectures: for a in architectures:
self._append(name, unstable, 'Packages_' + a, fields) self._append(name, unstable, 'Packages_' + a, fields)
else: else:

@ -210,12 +210,12 @@ class T(TestBase):
self.assertEqual(exc['darkgreen']['policy_info']['autopkgtest'], self.assertEqual(exc['darkgreen']['policy_info']['autopkgtest'],
{'darkgreen': { {'darkgreen': {
'amd64': ['RUNNING-ALWAYSFAIL', 'amd64': ['RUNNING-ALWAYSFAIL',
'https://autopkgtest.ubuntu.com/running', 'https://autopkgtest.ubuntu.com/status/pending',
'https://autopkgtest.ubuntu.com/packages/d/darkgreen/testing/amd64', 'https://autopkgtest.ubuntu.com/packages/d/darkgreen/testing/amd64',
None, None,
None], None],
'i386': ['RUNNING-ALWAYSFAIL', 'i386': ['RUNNING-ALWAYSFAIL',
'https://autopkgtest.ubuntu.com/running', 'https://autopkgtest.ubuntu.com/status/pending',
'https://autopkgtest.ubuntu.com/packages/d/darkgreen/testing/i386', 'https://autopkgtest.ubuntu.com/packages/d/darkgreen/testing/i386',
None, None,
None]}, None]},
@ -2229,12 +2229,12 @@ class T(TestBase):
self.assertEqual(exc['lightgreen']['policy_info']['autopkgtest'], self.assertEqual(exc['lightgreen']['policy_info']['autopkgtest'],
{'lightgreen': { {'lightgreen': {
'amd64': ['RUNNING-ALWAYSFAIL', 'amd64': ['RUNNING-ALWAYSFAIL',
'https://autopkgtest.ubuntu.com/running', 'https://autopkgtest.ubuntu.com/status/pending',
None, None,
None, None,
None], None],
'i386': ['RUNNING-ALWAYSFAIL', 'i386': ['RUNNING-ALWAYSFAIL',
'https://autopkgtest.ubuntu.com/running', 'https://autopkgtest.ubuntu.com/status/pending',
None, None,
None, None,
None]}, None]},
@ -2418,17 +2418,20 @@ class T(TestBase):
with open(debci_file, 'w') as f: with open(debci_file, 'w') as f:
f.write(''' f.write('''
[ {
["green/2", "darkgreen", "i386", "1", true, "20170917_100000"], "until": 12345,
["green/2", "darkgreen", "amd64", "1", true, "20170917_100000"], "results": [
["green/1", "lightgreen", "i386", "1", true, "20170917_101000"], {"trigger": "green/2", "package": "darkgreen", "arch": "i386", "version": "1", "status": "pass", "run_id": "100000"},
["green/2", "lightgreen", "i386", "1", false, "20170917_101001"], {"trigger": "green/2", "package": "darkgreen", "arch": "amd64", "version": "1", "status": "pass", "run_id": "100000"},
["green/1", "lightgreen", "amd64", "1", true, "20170917_101000"], {"trigger": "green/1", "package": "lightgreen", "arch": "i386", "version": "1", "status": "pass", "run_id": "101000"},
["green/2", "lightgreen", "amd64", "1", false, "20170917_101001"], {"trigger": "green/2", "package": "lightgreen", "arch": "i386", "version": "1", "status": "fail", "run_id": "101001"},
["green/2", "green", "i386", "2", true, "20170917_102000"], {"trigger": "green/1", "package": "lightgreen", "arch": "amd64", "version": "1", "status": "pass", "run_id": "101000"},
["green/1", "green", "amd64", "2", true, "20170917_102000"], {"trigger": "green/2", "package": "lightgreen", "arch": "amd64", "version": "1", "status": "fail", "run_id": "101001"},
["green/2", "green", "amd64", "2", false, "20170917_102001"] {"trigger": "green/2", "package": "green", "arch": "i386", "version": "2", "status": "pass", "run_id": "102000"},
] {"trigger": "green/1", "package": "green", "arch": "amd64", "version": "2", "status": "pass", "run_id": "102000"},
{"trigger": "green/2", "package": "green", "arch": "amd64", "version": "2", "status": "fail", "run_id": "102001"}
]
}
''') ''')
self.data.add_default_packages(green=False) self.data.add_default_packages(green=False)
@ -2448,7 +2451,7 @@ class T(TestBase):
self.assertEqual(exc['green']['policy_info']['autopkgtest']['lightgreen/1']['amd64'][0], self.assertEqual(exc['green']['policy_info']['autopkgtest']['lightgreen/1']['amd64'][0],
'REGRESSION') 'REGRESSION')
link = urllib.parse.urlparse(exc['green']['policy_info']['autopkgtest']['lightgreen/1']['amd64'][1]) link = urllib.parse.urlparse(exc['green']['policy_info']['autopkgtest']['lightgreen/1']['amd64'][1])
self.assertEqual(link.path, os.path.join(debci_file, 'autopkgtest-testing/testing/amd64/l/lightgreen/20170917_101001/log.gz')) self.assertEqual(link.path[-53:], '/autopkgtest/testing/amd64/l/lightgreen/101001/log.gz')
self.assertEqual(exc['green']['policy_info']['autopkgtest']['lightgreen/1']['amd64'][2:4], self.assertEqual(exc['green']['policy_info']['autopkgtest']['lightgreen/1']['amd64'][2:4],
['https://autopkgtest.ubuntu.com/packages/l/lightgreen/testing/amd64', ['https://autopkgtest.ubuntu.com/packages/l/lightgreen/testing/amd64',
None]) None])

Loading…
Cancel
Save