blob: c40aeb0a06f492a72cd245db6c201a2ec24339ca [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()
44 if not self.conf.image_ref:
45 raise self.skipException("No image configured to test.")
46 if not self.conf.instance_type:
47 raise self.skipException("No flavor configured to test.")
48 if not self.conf.minimal_instance_type:
49 raise self.skipException("No minimal flavor configured to test.")
50
51 def test_cancel_update_server_with_port(self):
52 parameters = {'InstanceType': self.conf.minimal_instance_type,
53 'ImageId': self.conf.image_ref,
54 'network': self.conf.fixed_network_name}
55
56 stack_identifier = self.stack_create(template=self.template,
57 parameters=parameters)
58 parameters['InstanceType'] = 'm1.large'
59 self.update_stack(stack_identifier, self.template,
60 parameters=parameters,
61 expected_status='UPDATE_IN_PROGRESS')
62
63 self.cancel_update_stack(stack_identifier)