Oleksii Chuprykov | fc2c58f | 2016-04-29 17:03:17 +0300 | [diff] [blame] | 1 | # 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 | |
| 13 | from heat_integrationtests.functional import functional_base |
| 14 | |
| 15 | |
| 16 | class CancelUpdateTest(functional_base.FunctionalTestsBase): |
| 17 | |
| 18 | template = ''' |
| 19 | heat_template_version: '2013-05-23' |
| 20 | parameters: |
| 21 | InstanceType: |
| 22 | type: string |
| 23 | ImageId: |
| 24 | type: string |
| 25 | network: |
| 26 | type: string |
| 27 | resources: |
| 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() |
rabi | c333f76 | 2016-09-29 08:34:03 +0530 | [diff] [blame] | 44 | if not self.conf.minimal_image_ref: |
| 45 | raise self.skipException("No minimal image configured to test") |
Oleksii Chuprykov | fc2c58f | 2016-04-29 17:03:17 +0300 | [diff] [blame] | 46 | 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, |
rabi | c333f76 | 2016-09-29 08:34:03 +0530 | [diff] [blame] | 51 | 'ImageId': self.conf.minimal_image_ref, |
Oleksii Chuprykov | fc2c58f | 2016-04-29 17:03:17 +0300 | [diff] [blame] | 52 | 'network': self.conf.fixed_network_name} |
| 53 | |
| 54 | stack_identifier = self.stack_create(template=self.template, |
| 55 | parameters=parameters) |
rabi | 8bba733 | 2016-12-06 12:11:48 +0530 | [diff] [blame] | 56 | parameters['InstanceType'] = self.conf.instance_type |
Oleksii Chuprykov | fc2c58f | 2016-04-29 17:03:17 +0300 | [diff] [blame] | 57 | self.update_stack(stack_identifier, self.template, |
| 58 | parameters=parameters, |
| 59 | expected_status='UPDATE_IN_PROGRESS') |
| 60 | |
| 61 | self.cancel_update_stack(stack_identifier) |