Merge "RandomString don't skip superclass validation"
This commit is contained in:
commit
dce34d7bf5
@ -226,6 +226,7 @@ class RandomString(resource.Resource):
|
||||
return random_string
|
||||
|
||||
def validate(self):
|
||||
super(RandomString, self).validate()
|
||||
sequence = self.properties.get(self.SEQUENCE)
|
||||
char_sequences = self.properties.get(self.CHARACTER_SEQUENCES)
|
||||
char_classes = self.properties.get(self.CHARACTER_CLASSES)
|
||||
|
@ -209,6 +209,20 @@ Resources:
|
||||
self.assertEqual(512, len(random_string))
|
||||
self.assertEqual(random_string, secret.FnGetRefId())
|
||||
|
||||
def test_exceeds_max_length(self):
|
||||
template_random_string = '''
|
||||
HeatTemplateFormatVersion: '2012-12-12'
|
||||
Resources:
|
||||
secret:
|
||||
Type: OS::Heat::RandomString
|
||||
Properties:
|
||||
length: 513
|
||||
'''
|
||||
exc = self.assertRaises(exception.StackValidationFailed,
|
||||
self.create_stack, template_random_string)
|
||||
self.assertIn('length 513 is out of range (min: 1, max: 512)',
|
||||
six.text_type(exc))
|
||||
|
||||
|
||||
class TestGenerateRandomString(common.HeatTestCase):
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user