|
|
|
@ -2181,8 +2181,9 @@ class T(TestBase):
|
|
|
|
|
def test_sourceppa_policy(self):
|
|
|
|
|
'''Packages from same source PPA get rejected for failed peer policy'''
|
|
|
|
|
|
|
|
|
|
self.sourceppa_cache['green'] = {'2': 'team/ubuntu/ppa'}
|
|
|
|
|
self.sourceppa_cache['red'] = {'2': 'team/ubuntu/ppa'}
|
|
|
|
|
ppa = 'devel/~ci-train-ppa-service/+archive/NNNN'
|
|
|
|
|
self.sourceppa_cache['green'] = {'2': ppa}
|
|
|
|
|
self.sourceppa_cache['red'] = {'2': ppa}
|
|
|
|
|
with open(os.path.join(self.data.path, 'data/series-proposed/Blocks'), 'w') as f:
|
|
|
|
|
f.write('green 12345 1471505000\ndarkgreen 98765 1471500000\n')
|
|
|
|
|
|
|
|
|
@ -2197,19 +2198,20 @@ class T(TestBase):
|
|
|
|
|
{'green': [('reason', 'block')],
|
|
|
|
|
'red': [('reason', 'source-ppa')]}
|
|
|
|
|
)[1]
|
|
|
|
|
self.assertEqual(exc['red']['policy_info']['source-ppa'], {'red': 'team/ubuntu/ppa', 'green': 'team/ubuntu/ppa'})
|
|
|
|
|
self.assertEqual(exc['red']['policy_info']['source-ppa'], {'red': ppa, 'green': ppa})
|
|
|
|
|
|
|
|
|
|
with open(os.path.join(self.data.path, 'data/series-proposed/SourcePPA')) as f:
|
|
|
|
|
res = json.load(f)
|
|
|
|
|
self.assertEqual(res, {'red': {'2': 'team/ubuntu/ppa'},
|
|
|
|
|
'green': {'2': 'team/ubuntu/ppa'},
|
|
|
|
|
self.assertEqual(res, {'red': {'2': ppa},
|
|
|
|
|
'green': {'2': ppa},
|
|
|
|
|
'gcc-5': {'1': ''}})
|
|
|
|
|
|
|
|
|
|
def test_sourceppa_missingbuild(self):
|
|
|
|
|
'''Packages from same source PPA get rejected for failed peer FTBFS'''
|
|
|
|
|
|
|
|
|
|
self.sourceppa_cache['green'] = {'2': 'team/ubuntu/ppa'}
|
|
|
|
|
self.sourceppa_cache['red'] = {'2': 'team/ubuntu/ppa'}
|
|
|
|
|
ppa = 'devel/~ci-train-ppa-service/+archive/ZZZZ'
|
|
|
|
|
self.sourceppa_cache['green'] = {'2': ppa}
|
|
|
|
|
self.sourceppa_cache['red'] = {'2': ppa}
|
|
|
|
|
|
|
|
|
|
self.data.add_src('green', True, {'Version': '2', 'Testsuite': 'autopkgtest'})
|
|
|
|
|
self.data.add('libgreen1', True, {'Version': '2', 'Source': 'green', 'Architecture': 'i386'}, add_src=False)
|
|
|
|
@ -2221,7 +2223,7 @@ class T(TestBase):
|
|
|
|
|
'on-unimportant-architectures': []})],
|
|
|
|
|
'red': [('reason', 'source-ppa')]}
|
|
|
|
|
)[1]
|
|
|
|
|
self.assertEqual(exc['red']['policy_info']['source-ppa'], {'red': 'team/ubuntu/ppa', 'green': 'team/ubuntu/ppa'})
|
|
|
|
|
self.assertEqual(exc['red']['policy_info']['source-ppa'], {'red': ppa, 'green': ppa})
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
unittest.main()
|
|
|
|
|