James E. Blair | 6ac4c13 | 2016-08-24 10:42:29 -0700 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | |
| 3 | # Copyright 2012 Hewlett-Packard Development Company, L.P. |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 6 | # not use this file except in compliance with the License. You may obtain |
| 7 | # a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 14 | # License for the specific language governing permissions and limitations |
| 15 | # under the License. |
| 16 | |
James E. Blair | 6ac4c13 | 2016-08-24 10:42:29 -0700 | [diff] [blame] | 17 | from tests.base import AnsibleZuulTestCase |
| 18 | |
James E. Blair | 6ac4c13 | 2016-08-24 10:42:29 -0700 | [diff] [blame] | 19 | |
| 20 | class TestOpenStack(AnsibleZuulTestCase): |
| 21 | # A temporary class to experiment with how openstack can use |
| 22 | # Zuulv3 |
| 23 | |
| 24 | tenant_config_file = 'config/openstack/main.yaml' |
| 25 | |
James E. Blair | 70911a7 | 2016-08-25 13:56:46 -0700 | [diff] [blame] | 26 | def test_nova_master(self): |
James E. Blair | 6ac4c13 | 2016-08-24 10:42:29 -0700 | [diff] [blame] | 27 | A = self.fake_gerrit.addFakeChange('openstack/nova', 'master', 'A') |
| 28 | A.addApproval('code-review', 2) |
| 29 | self.fake_gerrit.addEvent(A.addApproval('approved', 1)) |
| 30 | self.waitUntilSettled() |
| 31 | self.assertEqual(self.getJobFromHistory('python27').result, |
| 32 | 'SUCCESS') |
| 33 | self.assertEqual(self.getJobFromHistory('python35').result, |
| 34 | 'SUCCESS') |
| 35 | self.assertEqual(A.data['status'], 'MERGED') |
| 36 | self.assertEqual(A.reported, 2, |
| 37 | "A should report start and success") |
James E. Blair | 70911a7 | 2016-08-25 13:56:46 -0700 | [diff] [blame] | 38 | self.assertEqual(self.getJobFromHistory('python27').node, |
| 39 | 'ubuntu-xenial') |
| 40 | |
| 41 | def test_nova_mitaka(self): |
| 42 | self.create_branch('openstack/nova', 'stable/mitaka') |
| 43 | A = self.fake_gerrit.addFakeChange('openstack/nova', |
| 44 | 'stable/mitaka', 'A') |
| 45 | A.addApproval('code-review', 2) |
| 46 | self.fake_gerrit.addEvent(A.addApproval('approved', 1)) |
| 47 | self.waitUntilSettled() |
| 48 | self.assertEqual(self.getJobFromHistory('python27').result, |
| 49 | 'SUCCESS') |
| 50 | self.assertEqual(self.getJobFromHistory('python35').result, |
| 51 | 'SUCCESS') |
| 52 | self.assertEqual(A.data['status'], 'MERGED') |
| 53 | self.assertEqual(A.reported, 2, |
| 54 | "A should report start and success") |
| 55 | self.assertEqual(self.getJobFromHistory('python27').node, |
| 56 | 'ubuntu-trusty') |