blob: bfeeda64373bba3e80507971d04311b636044ec2 [file] [log] [blame]
Oleksii Chuprykovfc2c58f2016-04-29 17:03:17 +03001# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from heat_integrationtests.functional import functional_base
14
15
16class CancelUpdateTest(functional_base.FunctionalTestsBase):
17
18 template = '''
19heat_template_version: '2013-05-23'
20parameters:
21 InstanceType:
22 type: string
23 ImageId:
24 type: string
25 network:
26 type: string
27resources:
28 port:
29 type: OS::Neutron::Port
30 properties:
31 network: {get_param: network}
32 Server:
33 type: OS::Nova::Server
34 properties:
35 flavor_update_policy: REPLACE
36 image: {get_param: ImageId}
37 flavor: {get_param: InstanceType}
38 networks:
39 - port: {get_resource: port}
40'''
41
42 def setUp(self):
43 super(CancelUpdateTest, self).setUp()
rabic333f762016-09-29 08:34:03 +053044 if not self.conf.minimal_image_ref:
45 raise self.skipException("No minimal image configured to test")
Oleksii Chuprykovfc2c58f2016-04-29 17:03:17 +030046 if not self.conf.minimal_instance_type:
47 raise self.skipException("No minimal flavor configured to test.")
48
49 def test_cancel_update_server_with_port(self):
50 parameters = {'InstanceType': self.conf.minimal_instance_type,
rabic333f762016-09-29 08:34:03 +053051 'ImageId': self.conf.minimal_image_ref,
Oleksii Chuprykovfc2c58f2016-04-29 17:03:17 +030052 'network': self.conf.fixed_network_name}
53
54 stack_identifier = self.stack_create(template=self.template,
55 parameters=parameters)
rabi8bba7332016-12-06 12:11:48 +053056 parameters['InstanceType'] = self.conf.instance_type
Oleksii Chuprykovfc2c58f2016-04-29 17:03:17 +030057 self.update_stack(stack_identifier, self.template,
58 parameters=parameters,
59 expected_status='UPDATE_IN_PROGRESS')
60
61 self.cancel_update_stack(stack_identifier)