blob: 893dcc42d150ef1fc42fb286ee1a55135a9552e1 [file] [log] [blame]
Clint Byrum71f27632013-09-09 11:41:32 -07001# 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
13import logging
14
15from tempest.api.orchestration import base
Masayuki Igawa259c1132013-10-31 17:48:44 +090016from tempest.common.utils import data_utils
Matthew Treinishcb09bbb2014-01-29 18:20:25 +000017from tempest import config
Clint Byrum71f27632013-09-09 11:41:32 -070018from tempest import exceptions
19from tempest.test import attr
20
Matthew Treinishcb09bbb2014-01-29 18:20:25 +000021CONF = config.CONF
Clint Byrum71f27632013-09-09 11:41:32 -070022
23LOG = logging.getLogger(__name__)
24
25
26class TestServerStackLimits(base.BaseOrchestrationTest):
Clint Byrum71f27632013-09-09 11:41:32 -070027
28 @attr(type='gate')
29 def test_exceed_max_template_size_fails(self):
Sean Daguead824912014-03-25 14:56:35 -040030 stack_name = data_utils.rand_name('heat')
Matthew Treinishcb09bbb2014-01-29 18:20:25 +000031 fill = 'A' * CONF.orchestration.max_template_size
Clint Byrum71f27632013-09-09 11:41:32 -070032 template = '''
33HeatTemplateFormatVersion: '2012-12-12'
34Description: '%s'
35Outputs:
36 Foo: bar''' % fill
37 ex = self.assertRaises(exceptions.BadRequest, self.create_stack,
Sean Daguead824912014-03-25 14:56:35 -040038 stack_name, template)
Clint Byrum71f27632013-09-09 11:41:32 -070039 self.assertIn('Template exceeds maximum allowed size', str(ex))