blob: 2e0ed76be4b1592d2061465838c494c719c79c58 [file] [log] [blame]
Steve Baker10a4bc42015-07-23 10:21:02 +12001# 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.common import test
14
15
16class ParallelDeploymentsTest(test.HeatIntegrationTest):
17 template = '''
18heat_template_version: "2013-05-23"
19parameters:
20 flavor:
21 type: string
22 image:
23 type: string
24 network:
25 type: string
26resources:
27 server:
28 type: OS::Nova::Server
29 properties:
30 image: {get_param: image}
31 flavor: {get_param: flavor}
32 user_data_format: SOFTWARE_CONFIG
33 networks: [{network: {get_param: network} }]
34 config:
35 type: OS::Heat::SoftwareConfig
36 properties:
37 config: hi!
38 dep1:
39 type: OS::Heat::SoftwareDeployment
40 properties:
41 config: {get_resource: config}
42 server: {get_resource: server}
43 signal_transport: NO_SIGNAL
44 dep2:
45 type: OS::Heat::SoftwareDeployment
46 properties:
47 config: {get_resource: config}
48 server: {get_resource: server}
49 signal_transport: NO_SIGNAL
50 dep3:
51 type: OS::Heat::SoftwareDeployment
52 properties:
53 config: {get_resource: config}
54 server: {get_resource: server}
55 signal_transport: NO_SIGNAL
56 dep4:
57 type: OS::Heat::SoftwareDeployment
58 properties:
59 config: {get_resource: config}
60 server: {get_resource: server}
61 signal_transport: NO_SIGNAL
62'''
63
64 def setUp(self):
65 super(ParallelDeploymentsTest, self).setUp()
66 self.client = self.orchestration_client
67
68 def test_fail(self):
69 parms = {'flavor': self.conf.minimal_instance_type,
70 'network': self.conf.fixed_network_name,
71 'image': self.conf.minimal_image_ref}
72 stack_identifier = self.stack_create(
73 parameters=parms,
74 template=self.template)
75 stack = self.client.stacks.get(stack_identifier)
76 server_metadata = self.client.resources.metadata(stack.id, 'server')
77 self.assertEqual(4, len(server_metadata['deployments']))