Example #1
0
    def test_validate_no_parameters_in_group(self):
        t = template_format.parse(test_template_no_parameters)
        template = tmpl.HOTemplate20130523(t)
        stack = parser.Stack(self.ctx, 'test_stack', template)
        exc = self.assertRaises(exception.StackValidationFailed,
                                stack.validate)

        self.assertEqual(_('Parameters must be provided for each Parameter '
                         'Group.'), six.text_type(exc))
Example #2
0
    def test_validate_duplicate_parameters_in_group(self):
        t = template_format.parse(test_template_duplicate_parameters)
        template = tmpl.HOTemplate20130523(t)
        stack = parser.Stack(self.ctx, 'test_stack', template,
                             environment.Environment({
                                 'KeyName': 'test',
                                 'ImageId': 'sometestid',
                                 'db_password': '******'
                             }))
        exc = self.assertRaises(exception.StackValidationFailed,
                                stack.validate)

        self.assertEqual(_('The InstanceType parameter must be assigned to '
                         'one Parameter Group only.'), six.text_type(exc))
Example #3
0
    def test_validate_invalid_parameter_in_group(self):
        t = template_format.parse(test_template_invalid_parameter_name)
        template = tmpl.HOTemplate20130523(t)
        stack = parser.Stack(self.ctx, 'test_stack', template,
                             environment.Environment({
                                 'KeyName': 'test',
                                 'ImageId': 'sometestid',
                                 'db_password': '******'}))

        exc = self.assertRaises(exception.StackValidationFailed,
                                stack.validate)

        self.assertEqual(_('The Parameter name (SomethingNotHere) does not '
                         'reference an existing parameter.'),
                         six.text_type(exc))