blob: f845cf64317050c43ca2bc74eb9ed32984a768ed [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
17import logging
18
19from tests.base import AnsibleZuulTestCase
20
21logging.basicConfig(level=logging.DEBUG,
22 format='%(asctime)s %(name)-32s '
23 '%(levelname)-8s %(message)s')
24
25
26class TestOpenStack(AnsibleZuulTestCase):
27 # A temporary class to experiment with how openstack can use
28 # Zuulv3
29
30 tenant_config_file = 'config/openstack/main.yaml'
31
32 def test_openstack(self):
33 A = self.fake_gerrit.addFakeChange('openstack/nova', 'master', 'A')
34 A.addApproval('code-review', 2)
35 self.fake_gerrit.addEvent(A.addApproval('approved', 1))
36 self.waitUntilSettled()
37 self.assertEqual(self.getJobFromHistory('python27').result,
38 'SUCCESS')
39 self.assertEqual(self.getJobFromHistory('python35').result,
40 'SUCCESS')
41 self.assertEqual(A.data['status'], 'MERGED')
42 self.assertEqual(A.reported, 2,
43 "A should report start and success")