blob: d0c7ab216586cfd2a433223f1a9968528053e848 [file] [log] [blame]
James E. Blair6ac4c132016-08-24 10:42:29 -07001#!/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. Blair6ac4c132016-08-24 10:42:29 -070017from tests.base import AnsibleZuulTestCase
18
James E. Blair6ac4c132016-08-24 10:42:29 -070019
20class 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. Blair70911a72016-08-25 13:56:46 -070026 def test_nova_master(self):
James E. Blair6ac4c132016-08-24 10:42:29 -070027 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. Blair70911a72016-08-25 13:56:46 -070038 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')