greater granularity

This commit is contained in:
Chris Wolfe 2018-02-19 09:58:46 -06:00
parent 99d3362417
commit 8ac4ff1e99
2 changed files with 20 additions and 12 deletions

View File

@ -150,19 +150,15 @@ class SimpleSystemManagerBackend(BaseBackend):
'DocumentName': kwargs['DocumentName'],
'Comment': kwargs.get('Comment'),
'ExpiresAfter': expires_after.isoformat(),
'Parameters': {
'string': [
'string',
]
},
'Parameters': kwargs['Parameters'],
'InstanceIds': kwargs['InstanceIds'],
'Targets': kwargs.get('targets'),
'RequestedDateTime': now.isoformat(),
'Status': 'Success',
'StatusDetails': 'string',
'OutputS3Region': 'string',
'OutputS3BucketName': 'string',
'OutputS3KeyPrefix': 'string',
'OutputS3Region': kwargs.get('OutputS3Region'),
'OutputS3BucketName': kwargs.get('OutputS3BucketName'),
'OutputS3KeyPrefix': kwargs.get('OutputS3KeyPrefix'),
'MaxConcurrency': 'string',
'MaxErrors': 'string',
'TargetCount': len(instances),

View File

@ -463,15 +463,27 @@ def test_add_remove_list_tags_for_resource():
@mock_ssm
def test_send_command():
ssm_document = 'AWS-RunShellScript'
script = '#!/bin/bash\necho \'hello world\''
params = {'commands': ['#!/bin/bash\necho \'hello world\'']}
client = boto3.client('ssm', region_name='us-east-1')
before = datetime.datetime.now()
response = client.send_command(
InstanceIds=['i-123456'],
DocumentName=ssm_document,
TimeoutSeconds=60,
Parameters={'commands': [script]},
OutputS3BucketName='the-bucket'
Parameters=params,
OutputS3Region='us-east-2',
OutputS3BucketName='the-bucket',
OutputS3KeyPrefix='pref'
)
cmd = response['Command']
assert response['Command']
cmd['CommandId'].should_not.be(None)
cmd['DocumentName'].should.equal(ssm_document)
cmd['Parameters'].should.equal(params)
cmd['OutputS3Region'].should.equal('us-east-2')
cmd['OutputS3BucketName'].should.equal('the-bucket')
cmd['OutputS3KeyPrefix'].should.equal('pref')
cmd['ExpiresAfter'].should.be.greater_than(before)