mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
AWS instance tests 100% against real.
This commit is contained in:
parent
e748d175c2
commit
b87c104211
3 changed files with 10 additions and 8 deletions
|
@ -187,7 +187,7 @@ module Fog
|
|||
'ownerId' => instance['ownerId'],
|
||||
'reservationId' => instance['reservationId']
|
||||
}
|
||||
reservation_set[instance['reservationId']]['instancesSet'] << instance.reject{|key,value| !['amiLaunchIndex', 'architecture', 'blockDeviceMapping', 'clientToken', 'dnsName', 'imageId', 'instanceId', 'instanceState', 'instanceType', 'ipAddress', 'kernelId', 'keyName', 'launchTime', 'monitoring', 'placement', 'privateDnsName', 'privateIpAddress', 'productCodes', 'ramdiskId', 'reason', 'rootDeviceType', 'stateReason', 'tagSet'].include?(key)}
|
||||
reservation_set[instance['reservationId']]['instancesSet'] << instance.reject{|key,value| !['amiLaunchIndex', 'architecture', 'blockDeviceMapping', 'clientToken', 'dnsName', 'imageId', 'instanceId', 'instanceState', 'instanceType', 'kernelId', 'keyName', 'launchTime', 'monitoring', 'placement', 'privateDnsName', 'productCodes', 'ramdiskId', 'reason', 'rootDeviceType', 'stateReason', 'tagSet'].include?(key)}
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -135,14 +135,12 @@ module Fog
|
|||
'instanceId' => instance_id,
|
||||
'instanceState' => { 'code' => 0, 'name' => 'pending' },
|
||||
'instanceType' => options['InstanceType'] || 'm1.small',
|
||||
'kernelId' => options['KernelId'] || Fog::AWS::Mock.kernel_id,
|
||||
'keyName' => options['KeyName'],
|
||||
'launchTime' => Time.now,
|
||||
'monitoring' => { 'state' => options['Monitoring.Enabled'] || false },
|
||||
'placement' => { 'availabilityZone' => options['Placement.AvailabilityZone'] || Fog::AWS::Mock.availability_zone(@region) },
|
||||
'placement' => { 'availabilityZone' => options['Placement.AvailabilityZone'] || Fog::AWS::Mock.availability_zone(@region), 'groupName' => nil, 'tenancy' => 'default' },
|
||||
'privateDnsName' => nil,
|
||||
'productCodes' => [],
|
||||
'ramdiskId' => options['RamdiskId'] || Fog::AWS::Mock.ramdisk_id,
|
||||
'reason' => nil,
|
||||
'rootDeviceType' => 'instance-store'
|
||||
}
|
||||
|
|
|
@ -11,15 +11,19 @@ Shindo.tests('Fog::Compute[:aws] | instance requests', ['aws']) do
|
|||
'instanceState' => {'code' => Integer, 'name' => String},
|
||||
'instanceType' => String,
|
||||
# 'ipAddress' => String,
|
||||
'kernelId' => Fog::Nullable::String,
|
||||
# 'kernelId' => Fog::Nullable::String,
|
||||
'keyName' => Fog::Nullable::String,
|
||||
'launchTime' => Time,
|
||||
'monitoring' => {'state' => Fog::Boolean},
|
||||
'placement' => {'availabilityZone' => String},
|
||||
'placement' => {
|
||||
'availabilityZone' => String,
|
||||
'groupName' => Fog::Nullable::String,
|
||||
'tenancy' => String
|
||||
},
|
||||
'privateDnsName' => NilClass,
|
||||
# 'privateIpAddress' => String,
|
||||
'productCodes' => [],
|
||||
'ramdiskId' => Fog::Nullable::String,
|
||||
# 'ramdiskId' => Fog::Nullable::String,
|
||||
'reason' => Fog::Nullable::String,
|
||||
# 'rootDeviceName' => String,
|
||||
'rootDeviceType' => String,
|
||||
|
@ -100,7 +104,7 @@ Shindo.tests('Fog::Compute[:aws] | instance requests', ['aws']) do
|
|||
server.wait_for { ready? }
|
||||
|
||||
tests("#describe_instances").formats(@describe_instances_format) do
|
||||
Fog::Compute[:aws].describe_instances.body
|
||||
Fog::Compute[:aws].describe_instances('instance-state-name' => 'running').body
|
||||
end
|
||||
|
||||
# Launch another instance to test filters
|
||||
|
|
Loading…
Reference in a new issue