2009-08-17 22:55:30 +00:00
|
|
|
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2009-07-03 19:09:38 +00:00
|
|
|
|
|
|
|
describe 'EC2.describe_images' do
|
2009-08-20 03:32:57 +00:00
|
|
|
describe 'success' do
|
2009-07-03 19:09:38 +00:00
|
|
|
|
2009-08-20 03:32:57 +00:00
|
|
|
it "should return proper attributes with no params" do
|
2010-01-23 20:35:16 +00:00
|
|
|
actual = AWS[:ec2].describe_images
|
2009-08-20 03:32:57 +00:00
|
|
|
actual.body['requestId'].should be_a(String)
|
|
|
|
image = actual.body['imagesSet'].first
|
|
|
|
image['architecture'].should be_a(String)
|
|
|
|
image['imageId'].should be_a(String)
|
|
|
|
image['imageLocation'].should be_a(String)
|
|
|
|
image['imageOwnerId'].should be_a(String)
|
|
|
|
image['imageState'].should be_a(String)
|
|
|
|
image['imageType'].should be_a(String)
|
|
|
|
[false, true].should include(image['isPublic'])
|
|
|
|
image['kernelId'].should be_a(String) if image['kernelId']
|
|
|
|
image['platform'].should be_a(String) if image['platform']
|
|
|
|
image['ramdiskId'].should be_a(String) if image['ramdiskId']
|
2010-07-25 16:24:08 +00:00
|
|
|
image['rootDeviceName'].should be_a(String) if image['rootDeviceName']
|
|
|
|
["ebs","instance-store"].should include(image['rootDeviceType'])
|
|
|
|
image['rootDeviceName'].should be_a(String) if image['rootDeviceName']
|
2009-08-20 03:32:57 +00:00
|
|
|
end
|
2009-07-03 19:09:38 +00:00
|
|
|
|
2009-08-20 03:32:57 +00:00
|
|
|
it "should return proper attributes with params" do
|
2010-01-23 20:35:16 +00:00
|
|
|
actual = AWS[:ec2].describe_images('ImageId' => GENTOO_AMI)
|
2009-08-20 03:32:57 +00:00
|
|
|
actual.body['requestId'].should be_a(String)
|
|
|
|
image = actual.body['imagesSet'].first
|
|
|
|
image['architecture'].should be_a(String)
|
|
|
|
image['imageId'].should be_a(String)
|
|
|
|
image['imageLocation'].should be_a(String)
|
|
|
|
image['imageOwnerId'].should be_a(String)
|
|
|
|
image['imageState'].should be_a(String)
|
|
|
|
image['imageType'].should be_a(String)
|
|
|
|
[false, true].should include(image['isPublic'])
|
|
|
|
image['kernelId'].should be_a(String) if image['kernelId']
|
|
|
|
image['platform'].should be_a(String) if image['platform']
|
|
|
|
image['ramdiskId'].should be_a(String) if image['ramdiskId']
|
2010-07-25 16:24:08 +00:00
|
|
|
["ebs","instance-store"].should include(image['rootDeviceType'])
|
|
|
|
image['rootDeviceName'].should be_a(String) if image['rootDeviceName']
|
2009-08-20 03:32:57 +00:00
|
|
|
end
|
2009-07-03 19:09:38 +00:00
|
|
|
|
2009-08-20 03:32:57 +00:00
|
|
|
end
|
2009-07-03 19:09:38 +00:00
|
|
|
end
|