mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
test spot instance request parser
This commit is contained in:
parent
8a96a0d02d
commit
48e0d3f200
2 changed files with 5 additions and 2 deletions
|
@ -52,6 +52,8 @@ module Fog
|
|||
end
|
||||
when 'imageId', 'instanceType', 'keyname', 'subnetId'
|
||||
@spot_instance_request['launchSpecification'][name] = value
|
||||
when 'ebsOptimized'
|
||||
@spot_instance_request['launchSpecification'][name] = value == 'true'
|
||||
when 'enabled'
|
||||
@spot_instance_request['launchSpecification']['monitoring'] = (value == 'true')
|
||||
when 'requestId'
|
||||
|
|
|
@ -12,6 +12,7 @@ Shindo.tests('Fog::Compute[:aws] | spot instance requests', ['aws']) do
|
|||
'imageId' => String,
|
||||
'instanceType' => String,
|
||||
'monitoring' => Fog::Boolean,
|
||||
'ebsOptimized' => Fog::Boolean,
|
||||
'subnetId' => Fog::Nullable::String,
|
||||
'iamInstanceProfile' => Fog::Nullable::Hash,
|
||||
},
|
||||
|
@ -38,13 +39,13 @@ Shindo.tests('Fog::Compute[:aws] | spot instance requests', ['aws']) do
|
|||
pending if Fog.mocking?
|
||||
|
||||
tests("#request_spot_instances('ami-3202f25b', 't1.micro', '0.001')").formats(@spot_instance_requests_format) do
|
||||
data = Fog::Compute[:aws].request_spot_instances('ami-3202f25b', 't1.micro', '0.001').body
|
||||
data = Fog::Compute[:aws].request_spot_instances('ami-3202f25b', 't1.micro', '0.001',{'LaunchSpecification.EbsOptimized' => false}).body
|
||||
@spot_instance_request_id = data['spotInstanceRequestSet'].first['spotInstanceRequestId']
|
||||
data
|
||||
end
|
||||
|
||||
tests("#describe_spot_instance_requests").formats(@spot_instance_requests_format) do
|
||||
Fog::Compute[:aws].describe_spot_instance_requests.body
|
||||
Fog::Compute[:aws].describe_spot_instance_requests('spot-instance-request-id' => [@spot_instance_request_id]).body
|
||||
end
|
||||
|
||||
tests("#cancel_spot_instance_requests('#{@spot_instance_request_id}')").formats(@cancel_spot_instance_request_format) do
|
||||
|
|
Loading…
Reference in a new issue