mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-17 22:49:08 -07:00
* Moved the encryption to its own action method. * removed silly default value for encryption type. * Code formatting issues from pull request ANSIBOT. * changed version_added to "2.5" because of new new options available * changed version_added to "2.5" because of new new options available * changed version_added to "2.5" because of new new options available
This commit is contained in:
parent
2cb810544c
commit
e4f294822f
2 changed files with 291 additions and 8 deletions
|
@ -105,7 +105,8 @@ class AnsibleKinesisStreamFunctions(unittest.TestCase):
|
|||
'RetentionPeriodHours': 24,
|
||||
'StreamName': 'test',
|
||||
'StreamARN': 'arn:aws:kinesis:east-side:123456789:stream/test',
|
||||
'StreamStatus': 'ACTIVE'
|
||||
'StreamStatus': 'ACTIVE',
|
||||
'EncryptionType': 'NONE'
|
||||
}
|
||||
self.assertTrue(success)
|
||||
self.assertEqual(stream, should_return)
|
||||
|
@ -125,7 +126,8 @@ class AnsibleKinesisStreamFunctions(unittest.TestCase):
|
|||
'RetentionPeriodHours': 24,
|
||||
'StreamName': 'test',
|
||||
'StreamARN': 'arn:aws:kinesis:east-side:123456789:stream/test',
|
||||
'StreamStatus': 'ACTIVE'
|
||||
'StreamStatus': 'ACTIVE',
|
||||
'EncryptionType': 'NONE'
|
||||
}
|
||||
self.assertTrue(success)
|
||||
self.assertEqual(stream, should_return)
|
||||
|
@ -255,7 +257,8 @@ class AnsibleKinesisStreamFunctions(unittest.TestCase):
|
|||
'RetentionPeriodHours': 24,
|
||||
'StreamName': 'test',
|
||||
'StreamARN': 'arn:aws:kinesis:east-side:123456789:stream/test',
|
||||
'StreamStatus': 'ACTIVE'
|
||||
'StreamStatus': 'ACTIVE',
|
||||
'EncryptionType': 'NONE'
|
||||
}
|
||||
tags = {
|
||||
'env': 'development',
|
||||
|
@ -292,9 +295,32 @@ class AnsibleKinesisStreamFunctions(unittest.TestCase):
|
|||
'stream_name': 'test',
|
||||
'stream_arn': 'arn:aws:kinesis:east-side:123456789:stream/test',
|
||||
'stream_status': 'ACTIVE',
|
||||
'encryption_type': 'NONE',
|
||||
'tags': tags,
|
||||
}
|
||||
self.assertTrue(success)
|
||||
self.assertTrue(changed)
|
||||
self.assertEqual(results, should_return)
|
||||
self.assertEqual(err_msg, 'Kinesis Stream test updated successfully.')
|
||||
|
||||
def test_enable_stream_encription(self):
|
||||
client = boto3.client('kinesis', region_name=aws_region)
|
||||
success, changed, err_msg, results = (
|
||||
kinesis_stream.start_stream_encryption(
|
||||
client, 'test', encryption_type='KMS', key_id='', wait=True, wait_timeout=60, check_mode=True
|
||||
)
|
||||
)
|
||||
self.assertTrue(success)
|
||||
self.assertTrue(changed)
|
||||
self.assertEqual(err_msg, 'Kinesis Stream test encryption started successfully.')
|
||||
|
||||
def test_dsbale_stream_encryption(self):
|
||||
client = boto3.client('kinesis', region_name=aws_region)
|
||||
success, changed, err_msg, results = (
|
||||
kinesis_stream.stop_stream_encryption(
|
||||
client, 'test', encryption_type='KMS', key_id='', wait=True, wait_timeout=60, check_mode=True
|
||||
)
|
||||
)
|
||||
self.assertTrue(success)
|
||||
self.assertTrue(changed)
|
||||
self.assertEqual(err_msg, 'Kinesis Stream test encryption stopped successfully.')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue