mirror of
https://github.com/fog/fog-aws.git
synced 2022-11-09 13:50:52 -05:00
git grep -l "Compute::AWS" -- tests/ | xargs sed -i "" "s/Compute::AWS/AWS::Compute/g"
This commit is contained in:
parent
af3564d0db
commit
d9d9d2f97f
26 changed files with 113 additions and 113 deletions
|
@ -23,7 +23,7 @@ Shindo.tests('AWS | credentials', ['aws']) do
|
|||
:aws_secret_access_key => 'dummysecret',
|
||||
:aws_session_token => 'dummytoken',
|
||||
:region => "us-west-1",
|
||||
:aws_credentials_expire_at => expires_at}) { Fog::Compute::AWS.fetch_credentials(:use_iam_profile => true) }
|
||||
:aws_credentials_expire_at => expires_at}) { Fog::AWS::Compute.fetch_credentials(:use_iam_profile => true) }
|
||||
end
|
||||
|
||||
ENV["AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"] = '/v1/credentials?id=task_id'
|
||||
|
@ -34,12 +34,12 @@ Shindo.tests('AWS | credentials', ['aws']) do
|
|||
:aws_secret_access_key => 'dummysecret',
|
||||
:aws_session_token => 'dummytoken',
|
||||
:region => "us-west-1",
|
||||
:aws_credentials_expire_at => expires_at}) { Fog::Compute::AWS.fetch_credentials(:use_iam_profile => true) }
|
||||
:aws_credentials_expire_at => expires_at}) { Fog::AWS::Compute.fetch_credentials(:use_iam_profile => true) }
|
||||
end
|
||||
|
||||
ENV["AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"] = nil
|
||||
|
||||
compute = Fog::Compute::AWS.new(:use_iam_profile => true)
|
||||
compute = Fog::AWS::Compute.new(:use_iam_profile => true)
|
||||
|
||||
tests("#refresh_credentials_if_expired") do
|
||||
returns(nil){compute.refresh_credentials_if_expired}
|
||||
|
@ -58,11 +58,11 @@ Shindo.tests('AWS | credentials', ['aws']) do
|
|||
end
|
||||
Fog::Time.now = Time.now
|
||||
|
||||
default_credentials = Fog::Compute::AWS.fetch_credentials({})
|
||||
default_credentials = Fog::AWS::Compute.fetch_credentials({})
|
||||
tests("#fetch_credentials when the url 404s") do
|
||||
Excon.stub({:method => :get, :path => "/latest/meta-data/iam/security-credentials/"}, {:status => 404, :body => 'not bound'})
|
||||
Excon.stub({:method => :get, :path => "/latest/meta-data/placement/availability-zone/"}, {:status => 400, :body => 'not found'})
|
||||
returns(default_credentials) {Fog::Compute::AWS.fetch_credentials(:use_iam_profile => true)}
|
||||
returns(default_credentials) {Fog::AWS::Compute.fetch_credentials(:use_iam_profile => true)}
|
||||
end
|
||||
|
||||
mocked_credentials = {
|
||||
|
@ -73,8 +73,8 @@ Shindo.tests('AWS | credentials', ['aws']) do
|
|||
}
|
||||
tests("#fetch_credentials when mocking") do
|
||||
Fog.mock!
|
||||
Fog::Compute::AWS::Mock.data[:iam_role_based_creds] = mocked_credentials
|
||||
returns(mocked_credentials) {Fog::Compute::AWS.fetch_credentials(:use_iam_profile => true)}
|
||||
Fog::AWS::Compute::Mock.data[:iam_role_based_creds] = mocked_credentials
|
||||
returns(mocked_credentials) {Fog::AWS::Compute.fetch_credentials(:use_iam_profile => true)}
|
||||
end
|
||||
|
||||
ensure
|
||||
|
|
|
@ -36,7 +36,7 @@ Shindo.tests("Fog::Compute[:aws] | address", ['aws']) do
|
|||
end
|
||||
|
||||
model_tests(Fog::Compute[:aws].addresses, { :domain => "vpc" }, true) do
|
||||
tests("#change_scope").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#change_scope").raises(Fog::AWS::Compute::Error) do
|
||||
@instance.change_scope
|
||||
end
|
||||
end
|
||||
|
|
|
@ -38,7 +38,7 @@ Shindo.tests("Fog::Compute[:aws] | network_acl", ['aws']) do
|
|||
default_rules = @new_nacl.entries.dup
|
||||
|
||||
test("add a new inbound rule") do
|
||||
@new_nacl.add_inbound_rule(100, Fog::Compute::AWS::NetworkAcl::TCP, 'allow', '0.0.0.0/0', 'PortRange.From' => 22, 'PortRange.To' => 22)
|
||||
@new_nacl.add_inbound_rule(100, Fog::AWS::Compute::NetworkAcl::TCP, 'allow', '0.0.0.0/0', 'PortRange.From' => 22, 'PortRange.To' => 22)
|
||||
@new_nacl.reload
|
||||
(@new_nacl.entries - default_rules) == [{
|
||||
"icmpTypeCode" => {},
|
||||
|
@ -61,7 +61,7 @@ Shindo.tests("Fog::Compute[:aws] | network_acl", ['aws']) do
|
|||
end
|
||||
|
||||
test("add a new outbound rule") do
|
||||
@new_nacl.add_outbound_rule(100, Fog::Compute::AWS::NetworkAcl::TCP, 'allow', '0.0.0.0/0', 'PortRange.From' => 22, 'PortRange.To' => 22)
|
||||
@new_nacl.add_outbound_rule(100, Fog::AWS::Compute::NetworkAcl::TCP, 'allow', '0.0.0.0/0', 'PortRange.From' => 22, 'PortRange.To' => 22)
|
||||
@new_nacl.reload
|
||||
(@new_nacl.entries - default_rules) == [{
|
||||
"icmpTypeCode" => {},
|
||||
|
@ -84,8 +84,8 @@ Shindo.tests("Fog::Compute[:aws] | network_acl", ['aws']) do
|
|||
end
|
||||
|
||||
test("update rule") do
|
||||
@new_nacl.add_inbound_rule(100, Fog::Compute::AWS::NetworkAcl::TCP, 'allow', '0.0.0.0/0', 'PortRange.From' => 22, 'PortRange.To' => 22)
|
||||
@new_nacl.update_inbound_rule(100, Fog::Compute::AWS::NetworkAcl::TCP, 'allow', '10.0.0.0/8', 'PortRange.From' => 22, 'PortRange.To' => 22)
|
||||
@new_nacl.add_inbound_rule(100, Fog::AWS::Compute::NetworkAcl::TCP, 'allow', '0.0.0.0/0', 'PortRange.From' => 22, 'PortRange.To' => 22)
|
||||
@new_nacl.update_inbound_rule(100, Fog::AWS::Compute::NetworkAcl::TCP, 'allow', '10.0.0.0/8', 'PortRange.From' => 22, 'PortRange.To' => 22)
|
||||
@new_nacl.reload
|
||||
(@new_nacl.entries - default_rules) == [{
|
||||
"icmpTypeCode" => {},
|
||||
|
|
|
@ -85,7 +85,7 @@ Shindo.tests("Fog::Compute[:aws] | security_group", ['aws']) do
|
|||
{ @other_user_id => @other_users_group_id }
|
||||
].each do |group_arg|
|
||||
test("does not authorize port range access by an invalid security group #{group_arg.inspect}") do
|
||||
raises(Fog::Compute::AWS::NotFound, "The security group '#{@other_users_group_id}' does not exist") {
|
||||
raises(Fog::AWS::Compute::NotFound, "The security group '#{@other_users_group_id}' does not exist") {
|
||||
@other_group.reload
|
||||
@group.authorize_port_range(5000..6000, {:group => group_arg})
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ Shindo.tests('Fog::Compute[:aws] | volume', ['aws']) do
|
|||
@instance.server.nil?
|
||||
end
|
||||
|
||||
tests('#server=').raises(NoMethodError, 'use Fog::Compute::AWS::Volume#attach(server, device)') do
|
||||
tests('#server=').raises(NoMethodError, 'use Fog::AWS::Compute::Volume#attach(server, device)') do
|
||||
@instance.server = @server
|
||||
end
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Shindo.tests('AWS::ELB | models', ['aws', 'elb']) do
|
||||
Fog::Compute::AWS::Mock.reset if Fog.mocking?
|
||||
Fog::AWS::Compute::Mock.reset if Fog.mocking?
|
||||
@availability_zones = Fog::Compute[:aws].describe_availability_zones('state' => 'available').body['availabilityZoneInfo'].map{ |az| az['zoneName'] }
|
||||
@key_name = 'fog-test-model'
|
||||
@vpc = Fog::Compute[:aws].vpcs.create('cidr_block' => '10.0.10.0/24')
|
||||
|
|
|
@ -24,9 +24,9 @@ DESCRIBE_IMAGES_RESULT = <<-EOF
|
|||
</DescribeImagesResponse>
|
||||
EOF
|
||||
|
||||
Shindo.tests('Compute::AWS | parsers | describe_images', ['compute', 'aws', 'parser']) do
|
||||
Shindo.tests('AWS::Compute | parsers | describe_images', ['compute', 'aws', 'parser']) do
|
||||
tests('parses the xml').formats(AWS::Compute::Formats::DESCRIBE_IMAGES) do
|
||||
parser = Nokogiri::XML::SAX::Parser.new(Fog::Parsers::Compute::AWS::DescribeImages.new)
|
||||
parser = Nokogiri::XML::SAX::Parser.new(Fog::Parsers::AWS::Compute::DescribeImages.new)
|
||||
parser.parse(DESCRIBE_IMAGES_RESULT)
|
||||
parser.document.response
|
||||
end
|
||||
|
|
|
@ -72,7 +72,7 @@ Shindo.tests('Fog::Compute[:aws] | address requests', ['aws']) do
|
|||
compute.associate_address({:instance_id=>@server.id, :allocation_id=>@vpc_allocation_id}).body
|
||||
end
|
||||
|
||||
tests("#disassociate_address('#{@vpc_public_ip}')").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#disassociate_address('#{@vpc_public_ip}')").raises(Fog::AWS::Compute::Error) do
|
||||
compute.disassociate_address(@vpc_public_ip)
|
||||
end
|
||||
|
||||
|
@ -95,38 +95,38 @@ Shindo.tests('Fog::Compute[:aws] | address requests', ['aws']) do
|
|||
@address = compute.addresses.create
|
||||
@vpc_address = compute.addresses.create(:domain => 'vpc')
|
||||
|
||||
tests("#associate_addresses({:instance_id =>'i-00000000', :public_ip => '#{@address.identity}')}").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#associate_addresses({:instance_id =>'i-00000000', :public_ip => '#{@address.identity}')}").raises(Fog::AWS::Compute::NotFound) do
|
||||
compute.associate_address({:instance_id => 'i-00000000', :public_ip => @address.identity})
|
||||
end
|
||||
|
||||
tests("#associate_addresses({:instance_id =>'#{@server.identity}', :public_ip => '127.0.0.1'})").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#associate_addresses({:instance_id =>'#{@server.identity}', :public_ip => '127.0.0.1'})").raises(Fog::AWS::Compute::Error) do
|
||||
compute.associate_address({:instance_id => @server.identity, :public_ip => '127.0.0.1'})
|
||||
end
|
||||
|
||||
tests("#associate_addresses({:instance_id =>'i-00000000', :public_ip => '127.0.0.1'})").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#associate_addresses({:instance_id =>'i-00000000', :public_ip => '127.0.0.1'})").raises(Fog::AWS::Compute::NotFound) do
|
||||
compute.associate_address({:instance_id =>'i-00000000', :public_ip =>'127.0.0.1'})
|
||||
end
|
||||
|
||||
tests("#restore_address_to_classic('#{@vpc_address.identity}')").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#restore_address_to_classic('#{@vpc_address.identity}')").raises(Fog::AWS::Compute::Error) do
|
||||
compute.restore_address_to_classic(@vpc_address.identity)
|
||||
end
|
||||
|
||||
tests("#disassociate_addresses('127.0.0.1') raises BadRequest error").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#disassociate_addresses('127.0.0.1') raises BadRequest error").raises(Fog::AWS::Compute::Error) do
|
||||
compute.disassociate_address('127.0.0.1')
|
||||
end
|
||||
|
||||
tests("#release_address('127.0.0.1')").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#release_address('127.0.0.1')").raises(Fog::AWS::Compute::Error) do
|
||||
compute.release_address('127.0.0.1')
|
||||
end
|
||||
|
||||
tests("#release_address('#{@vpc_address.identity}')").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#release_address('#{@vpc_address.identity}')").raises(Fog::AWS::Compute::Error) do
|
||||
compute.release_address(@vpc_address.identity)
|
||||
end
|
||||
|
||||
if Fog.mocking?
|
||||
old_limit = compute.data[:limits][:addresses]
|
||||
|
||||
tests("#allocate_address", "limit exceeded").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#allocate_address", "limit exceeded").raises(Fog::AWS::Compute::Error) do
|
||||
compute.data[:limits][:addresses] = 0
|
||||
compute.allocate_address
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Shindo.tests('Fog::Compute[:aws] | internet_gateway requests', ['aws']) do
|
||||
|
||||
tests('success') do
|
||||
Fog::Compute::AWS::Mock.reset if Fog.mocking?
|
||||
Fog::AWS::Compute::Mock.reset if Fog.mocking?
|
||||
|
||||
@vpc=Fog::Compute[:aws].vpcs.create('cidr_block' => '10.0.10.0/24')
|
||||
@vpc_id = @vpc.id
|
||||
|
@ -30,7 +30,7 @@ Shindo.tests('Fog::Compute[:aws] | internet_gateway requests', ['aws']) do
|
|||
end
|
||||
|
||||
tests('failure') do
|
||||
Fog::Compute::AWS::Mock.reset if Fog.mocking?
|
||||
Fog::AWS::Compute::Mock.reset if Fog.mocking?
|
||||
|
||||
@vpc=Fog::Compute[:aws].vpcs.create('cidr_block' => '10.0.10.0/24')
|
||||
@vpc_id = @vpc.id
|
||||
|
@ -44,7 +44,7 @@ Shindo.tests('Fog::Compute[:aws] | internet_gateway requests', ['aws']) do
|
|||
|
||||
@ip_address = Fog::AWS::Mock.ip_address
|
||||
|
||||
tests("#assign_private_ip_addresses('#{@network_interface_id}', {'PrivateIpAddresses'=>['#{@ip_address}','#{@second_ip_address}'], 'SecondaryPrivateIpAddressCount'=>4 })").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#assign_private_ip_addresses('#{@network_interface_id}', {'PrivateIpAddresses'=>['#{@ip_address}','#{@second_ip_address}'], 'SecondaryPrivateIpAddressCount'=>4 })").raises(Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].assign_private_ip_addresses(@network_interface_id, { 'PrivateIpAddresses' =>[@ip_address, @second_ip_address], 'SecondaryPrivateIpAddressCount'=>4 }).body
|
||||
end
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ Shindo.tests('Fog::Compute[:aws] | image requests', ['aws']) do
|
|||
@image_id = 'ami-1aad5273'
|
||||
|
||||
if Fog.mocking?
|
||||
@other_account = Fog::Compute::AWS.new(:aws_access_key_id => 'other', :aws_secret_access_key => 'account')
|
||||
@other_account = Fog::AWS::Compute.new(:aws_access_key_id => 'other', :aws_secret_access_key => 'account')
|
||||
|
||||
@server = Fog::Compute[:aws].servers.create
|
||||
@server.wait_for{state == 'running'}
|
||||
|
@ -151,7 +151,7 @@ Shindo.tests('Fog::Compute[:aws] | image requests', ['aws']) do
|
|||
Fog::Compute[:aws].modify_image_attribute(nil, { 'Add.Group' => ['all'] }).body
|
||||
end
|
||||
|
||||
tests("#modify_image_attribute('ami-00000000', { 'Add.UserId' => ['123456789012'] })").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#modify_image_attribute('ami-00000000', { 'Add.UserId' => ['123456789012'] })").raises(Fog::AWS::Compute::NotFound) do
|
||||
pending unless Fog.mocking?
|
||||
|
||||
Fog::Compute[:aws].modify_image_attribute('ami-00000000', { 'Add.UserId' => ['123456789012'] }).body
|
||||
|
|
|
@ -159,7 +159,7 @@ Shindo.tests('Fog::Compute[:aws] | describe_instance_attribute request', ['aws']
|
|||
|
||||
tests('failure') do
|
||||
@instance_attributes.each do |attrib|
|
||||
tests("#describe_instance_attribute('i-00000000', #{attrib})").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#describe_instance_attribute('i-00000000', #{attrib})").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].describe_instance_attribute('i-00000000', attrib)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -314,22 +314,22 @@ Shindo.tests('Fog::Compute[:aws] | instance requests', ['aws']) do
|
|||
|
||||
tests('failure') do
|
||||
|
||||
tests("#run_instances(nil, 1, 1, {'SubnetId'=>'subnet-00000000'}").raises(::Fog::Compute::AWS::Error) do
|
||||
tests("#run_instances(nil, 1, 1, {'SubnetId'=>'subnet-00000000'}").raises(::Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].run_instances(nil, 1, 1, {'SubnetId' => 'subnet-000000'})
|
||||
end
|
||||
tests("#get_console_output('i-00000000')").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#get_console_output('i-00000000')").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].get_console_output('i-00000000')
|
||||
end
|
||||
|
||||
tests("#get_password_data('i-00000000')").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#get_password_data('i-00000000')").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].get_password_data('i-00000000')
|
||||
end
|
||||
|
||||
tests("#reboot_instances('i-00000000')").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#reboot_instances('i-00000000')").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].reboot_instances('i-00000000')
|
||||
end
|
||||
|
||||
tests("#terminate_instances('i-00000000')").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#terminate_instances('i-00000000')").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].terminate_instances('i-00000000')
|
||||
end
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ Shindo.tests('Fog::Compute[:aws] | internet_gateway requests', ['aws']) do
|
|||
}
|
||||
|
||||
tests('success') do
|
||||
Fog::Compute::AWS::Mock.reset if Fog.mocking?
|
||||
Fog::AWS::Compute::Mock.reset if Fog.mocking?
|
||||
@vpc=Fog::Compute[:aws].vpcs.create('cidr_block' => '10.0.10.0/24')
|
||||
@vpc_id = @vpc.id
|
||||
@subnet=Fog::Compute[:aws].subnets.create('vpc_id' => @vpc_id, 'cidr_block' => '10.0.10.0/24')
|
||||
|
|
|
@ -56,7 +56,7 @@ Shindo.tests('Fog::Compute[:aws] | key pair requests', ['aws']) do
|
|||
|
||||
@key_pair = Fog::Compute[:aws].key_pairs.create(:name => 'fog_key_pair')
|
||||
|
||||
tests("duplicate #create_key_pair('#{@key_pair.name}')").raises(Fog::Compute::AWS::Error) do
|
||||
tests("duplicate #create_key_pair('#{@key_pair.name}')").raises(Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].create_key_pair(@key_pair.name)
|
||||
end
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ Shindo.tests('Fog::Compute[:aws] | network acl requests', ['aws']) do
|
|||
}
|
||||
|
||||
tests('success') do
|
||||
Fog::Compute::AWS::Mock.reset if Fog.mocking?
|
||||
Fog::AWS::Compute::Mock.reset if Fog.mocking?
|
||||
|
||||
@vpc = Fog::Compute[:aws].vpcs.create('cidr_block' => '10.0.10.0/24')
|
||||
@subnet = Fog::Compute[:aws].subnets.create('vpc_id' => @vpc.id, 'cidr_block' => '10.0.10.16/28')
|
||||
|
@ -107,6 +107,6 @@ Shindo.tests('Fog::Compute[:aws] | network acl requests', ['aws']) do
|
|||
@another_acl.destroy
|
||||
@subnet.destroy
|
||||
@vpc.destroy
|
||||
Fog::Compute::AWS::Mock.reset if Fog.mocking?
|
||||
Fog::AWS::Compute::Mock.reset if Fog.mocking?
|
||||
end
|
||||
end
|
||||
|
|
|
@ -36,7 +36,7 @@ Shindo.tests('Fog::Compute[:aws] | network interface requests', ['aws']) do
|
|||
}
|
||||
|
||||
tests('success') do
|
||||
Fog::Compute::AWS::Mock.reset if Fog.mocking?
|
||||
Fog::AWS::Compute::Mock.reset if Fog.mocking?
|
||||
|
||||
# Create environment
|
||||
@vpc = Fog::Compute[:aws].vpcs.create('cidr_block' => '10.0.10.0/24')
|
||||
|
@ -197,7 +197,7 @@ Shindo.tests('Fog::Compute[:aws] | network interface requests', ['aws']) do
|
|||
tests('failure') do
|
||||
|
||||
# Attempt to attach a nonexistent interface
|
||||
tests("#attach_network_interface('eni-00000000', 'i-00000000', '1')").raises(::Fog::Compute::AWS::NotFound) do
|
||||
tests("#attach_network_interface('eni-00000000', 'i-00000000', '1')").raises(::Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].attach_network_interface('eni-00000000', 'i-00000000', '1')
|
||||
end
|
||||
|
||||
|
@ -213,12 +213,12 @@ Shindo.tests('Fog::Compute[:aws] | network interface requests', ['aws']) do
|
|||
# Attempt to re-use an existing IP for another ENI
|
||||
tests("#create_network_interface('#{@subnet_id}', " \
|
||||
"{'PrivateIpAddress' => " \
|
||||
"'#{data['networkInterface']['privateIpAddress']}'}").raises(::Fog::Compute::AWS::Error) do
|
||||
"'#{data['networkInterface']['privateIpAddress']}'}").raises(::Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].create_network_interface(@subnet_id, {'PrivateIpAddress' => data['networkInterface']['privateIpAddress']})
|
||||
end
|
||||
|
||||
# Attempt to attach a valid ENI to a nonexistent instance.
|
||||
tests("#attach_network_interface('#{@nic_id}', 'i-00000000', '0')").raises(::Fog::Compute::AWS::NotFound) do
|
||||
tests("#attach_network_interface('#{@nic_id}', 'i-00000000', '0')").raises(::Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].attach_network_interface(@nic_id, 'i-00000000', '0')
|
||||
end
|
||||
|
||||
|
@ -230,10 +230,10 @@ Shindo.tests('Fog::Compute[:aws] | network interface requests', ['aws']) do
|
|||
|
||||
# Attempt to attach two ENIs to the same instance with the same device
|
||||
# index.
|
||||
tests("#attach_network_interface('#{@nic_id}', '#{@instance_id}', '#{@device_index}')").raises(::Fog::Compute::AWS::Error) do
|
||||
tests("#attach_network_interface('#{@nic_id}', '#{@instance_id}', '#{@device_index}')").raises(::Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].attach_network_interface(@nic_id, @instance_id, @device_index)
|
||||
end
|
||||
|
||||
Fog::Compute::AWS::Mock.reset if Fog.mocking?
|
||||
Fog::AWS::Compute::Mock.reset if Fog.mocking?
|
||||
end
|
||||
end
|
||||
|
|
|
@ -35,11 +35,11 @@ Shindo.tests('Fog::Compute[:aws] | placement group requests', ['aws']) do
|
|||
|
||||
Fog::Compute[:aws].create_placement_group('fog_placement_group', 'cluster')
|
||||
|
||||
tests("duplicate #create_placement_group('fog_placement_group', 'cluster')").raises(Fog::Compute::AWS::Error) do
|
||||
tests("duplicate #create_placement_group('fog_placement_group', 'cluster')").raises(Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].create_placement_group('fog_placement_group', 'cluster')
|
||||
end
|
||||
|
||||
tests("#delete_placement_group('not_a_group_name')").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#delete_placement_group('not_a_group_name')").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].delete_placement_group('not_a_group_name')
|
||||
end
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ Shindo.tests('Fog::Compute[:aws] | region requests', ['aws']) do
|
|||
tests("#incorrect_region") do
|
||||
|
||||
raises(ArgumentError, "Unknown region: world-antarctica-1") do
|
||||
Fog::Compute::AWS.new({:aws_access_key_id => 'dummykey',
|
||||
Fog::AWS::Compute.new({:aws_access_key_id => 'dummykey',
|
||||
:aws_secret_access_key => 'dummysecret',
|
||||
:aws_session_token => 'dummytoken',
|
||||
:region => 'world-antarctica-1'})
|
||||
|
@ -30,7 +30,7 @@ Shindo.tests('Fog::Compute[:aws] | region requests', ['aws']) do
|
|||
end
|
||||
|
||||
tests("#unknown_endpoint").formats(@regions_format) do
|
||||
Fog::Compute::AWS.new({:aws_access_key_id => 'dummykey',
|
||||
Fog::AWS::Compute.new({:aws_access_key_id => 'dummykey',
|
||||
:aws_secret_access_key => 'dummysecret',
|
||||
:aws_session_token => 'dummytoken',
|
||||
:region => 'world-antarctica-1',
|
||||
|
@ -38,8 +38,8 @@ Shindo.tests('Fog::Compute[:aws] | region requests', ['aws']) do
|
|||
end
|
||||
|
||||
tests("#invalid_endpoint") do
|
||||
raises(Fog::Compute::AWS::InvalidURIError) do
|
||||
Fog::Compute::AWS.new({:aws_access_key_id => 'dummykey',
|
||||
raises(Fog::AWS::Compute::InvalidURIError) do
|
||||
Fog::AWS::Compute.new({:aws_access_key_id => 'dummykey',
|
||||
:aws_secret_access_key => 'dummysecret',
|
||||
:aws_session_token => 'dummytoken',
|
||||
:region => 'world-antarctica-1',
|
||||
|
|
|
@ -41,7 +41,7 @@ Shindo.tests('Fog::Compute[:aws] | route table requests', ['aws']) do
|
|||
'requestId' => String
|
||||
}
|
||||
|
||||
Fog::Compute::AWS::Mock.reset if Fog.mocking?
|
||||
Fog::AWS::Compute::Mock.reset if Fog.mocking?
|
||||
vpc = Fog::Compute[:aws].vpcs.create('cidr_block' => '10.0.10.0/24')
|
||||
if !Fog.mocking?
|
||||
vpc.wait_for { state.eql? "available" }
|
||||
|
@ -174,7 +174,7 @@ Shindo.tests('Fog::Compute[:aws] | route table requests', ['aws']) do
|
|||
tests('#create_route_table').raises(ArgumentError) do
|
||||
Fog::Compute[:aws].create_route_table
|
||||
end
|
||||
tests("#create_route_table('vpc-00000000')").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#create_route_table('vpc-00000000')").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].create_route_table('vpc-00000000')
|
||||
end
|
||||
|
||||
|
@ -186,10 +186,10 @@ Shindo.tests('Fog::Compute[:aws] | route table requests', ['aws']) do
|
|||
tests('#associate_route_table').raises(ArgumentError) do
|
||||
Fog::Compute[:aws].associate_route_table
|
||||
end
|
||||
tests("#associate_route_table('rtb-00000000', '#{@subnet_id}')").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#associate_route_table('rtb-00000000', '#{@subnet_id}')").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].associate_route_table('rtb-00000000', @subnet_id)
|
||||
end
|
||||
tests("#associate_route_table('#{@route_table_id}', 'subnet-00000000')").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#associate_route_table('#{@route_table_id}', 'subnet-00000000')").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].associate_route_table(@route_table_id, 'subnet-00000000')
|
||||
end
|
||||
|
||||
|
@ -207,30 +207,30 @@ Shindo.tests('Fog::Compute[:aws] | route table requests', ['aws']) do
|
|||
tests('#create_route').raises(ArgumentError) do
|
||||
Fog::Compute[:aws].create_route
|
||||
end
|
||||
tests("#create_route('rtb-00000000', '#{@destination_cidr_block}', '#{@internet_gateway_id}')").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#create_route('rtb-00000000', '#{@destination_cidr_block}', '#{@internet_gateway_id}')").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].create_route('rtb-00000000', @destination_cidr_block, @internet_gateway_id)
|
||||
end
|
||||
tests("#create_route('#{@route_table_id}', '#{@destination_cidr_block}', 'igw-00000000')").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#create_route('#{@route_table_id}', '#{@destination_cidr_block}', 'igw-00000000')").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].create_route(@route_table_id, @destination_cidr_block, 'igw-00000000')
|
||||
end
|
||||
tests("#create_route('rtb-00000000', '#{@destination_cidr_block}', 'nil', '#{instance.id}')").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#create_route('rtb-00000000', '#{@destination_cidr_block}', 'nil', '#{instance.id}')").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].create_route('rtb-00000000', @destination_cidr_block, instance.id)
|
||||
end
|
||||
tests("#create_route('#{@route_table_id}', '#{@destination_cidr_block}', 'nil', 'i-00000000')").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#create_route('#{@route_table_id}', '#{@destination_cidr_block}', 'nil', 'i-00000000')").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].create_route(@route_table_id, @destination_cidr_block, nil, 'i-00000000')
|
||||
end
|
||||
tests("#create_route('#{@route_table_id}', '#{@destinationCidrBlock}', 'nil', 'nil', 'eni-00000000')").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#create_route('#{@route_table_id}', '#{@destinationCidrBlock}', 'nil', 'nil', 'eni-00000000')").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].create_route(@route_table_id, @destination_cidr_block, nil, nil, 'eni-00000000')
|
||||
end
|
||||
tests("#create_route('#rtb-00000000', '#{@destination_cidr_block}', 'nil, 'nil', '#{@network_interface_id}')").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#create_route('#rtb-00000000', '#{@destination_cidr_block}', 'nil, 'nil', '#{@network_interface_id}')").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].create_route('rtb-00000000', @destination_cidr_block, nil, nil, @network_interface_id)
|
||||
end
|
||||
tests("#create_route same destination_cidr_block").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#create_route same destination_cidr_block").raises(Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].create_route(@route_table_id, @destination_cidr_block, @internet_gateway_id)
|
||||
Fog::Compute[:aws].create_route(@route_table_id, @destination_cidr_block, nil, nil, @network_interface_id).body
|
||||
end
|
||||
if !Fog.mocking?
|
||||
tests("#create_route less specific destination_cidr_block").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#create_route less specific destination_cidr_block").raises(Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].create_route(@route_table_id, '10.0.10.0/25', @internet_gateway_id)
|
||||
Fog::Compute[:aws].delete_route(@route_table_id, @destination_cidr_block).body
|
||||
end
|
||||
|
@ -249,29 +249,29 @@ Shindo.tests('Fog::Compute[:aws] | route table requests', ['aws']) do
|
|||
tests('#replace_route').raises(ArgumentError) do
|
||||
Fog::Compute[:aws].replace_route
|
||||
end
|
||||
tests("#replace_route('rtb-00000000', '#{@destination_cidr_block}', {'internetGatewayId' => '#{@internet_gateway_id}'})").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#replace_route('rtb-00000000', '#{@destination_cidr_block}', {'internetGatewayId' => '#{@internet_gateway_id}'})").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].replace_route('rtb-00000000', @destination_cidr_block, {'internetGatewayId' => @internet_gateway_id})
|
||||
end
|
||||
tests("#replace_route('rtb-00000000', '#{@destination_cidr_block}')").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#replace_route('rtb-00000000', '#{@destination_cidr_block}')").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].replace_route('rtb-00000000', @destination_cidr_block)
|
||||
end
|
||||
tests("#replace_route('#{@route_table_id}', '#{@destination_cidr_block}', {'gatewayId' => 'igw-00000000'})").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#replace_route('#{@route_table_id}', '#{@destination_cidr_block}', {'gatewayId' => 'igw-00000000'})").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].replace_route(@route_table_id, @destination_cidr_block, {'gatewayId' => 'igw-00000000'})
|
||||
end
|
||||
tests("#replace_route('rtb-00000000', '#{@destination_cidr_block}', {'instanceId' => '#{instance.id}'})").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#replace_route('rtb-00000000', '#{@destination_cidr_block}', {'instanceId' => '#{instance.id}'})").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].replace_route('rtb-00000000', @destination_cidr_block, {'instanceId' => instance.id})
|
||||
end
|
||||
tests("#replace_route('#{@route_table_id}', '#{@destination_cidr_block}', {'instanceId' => 'i-00000000'})").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#replace_route('#{@route_table_id}', '#{@destination_cidr_block}', {'instanceId' => 'i-00000000'})").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].replace_route(@route_table_id, @destination_cidr_block, {'instanceId' => 'i-00000000'})
|
||||
end
|
||||
tests("#replace_route('#{@route_table_id}', '#{@destination_cidr_block}', {'networkInterfaceId' => 'eni-00000000'})").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#replace_route('#{@route_table_id}', '#{@destination_cidr_block}', {'networkInterfaceId' => 'eni-00000000'})").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].replace_route(@route_table_id, @destination_cidr_block, {'networkInterfaceId' => 'eni-00000000'})
|
||||
end
|
||||
tests("#replace_route('rtb-00000000', '#{@destination_cidr_block}', {'networkInterfaceId' => '#{@network_interface_id}'})").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#replace_route('rtb-00000000', '#{@destination_cidr_block}', {'networkInterfaceId' => '#{@network_interface_id}'})").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].replace_route('rtb-00000000', @destination_cidr_block, {'networkInterfaceId' => @network_interface_id})
|
||||
end
|
||||
if !Fog.mocking?
|
||||
tests("#replace_route less specific destination_cidr_block").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#replace_route less specific destination_cidr_block").raises(Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].replace_route(@route_table_id, '10.0.10.0/25', {'gatewayId' => @internet_gateway_id})
|
||||
end
|
||||
end
|
||||
|
@ -290,7 +290,7 @@ Shindo.tests('Fog::Compute[:aws] | route table requests', ['aws']) do
|
|||
tests('#delete_route').raises(ArgumentError) do
|
||||
Fog::Compute[:aws].delete_route
|
||||
end
|
||||
tests("#delete_route('rtb-00000000', '#{@destination_cidr_block}')").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#delete_route('rtb-00000000', '#{@destination_cidr_block}')").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].delete_route('rtb-00000000', @destination_cidr_block)
|
||||
end
|
||||
|
||||
|
@ -301,7 +301,7 @@ Shindo.tests('Fog::Compute[:aws] | route table requests', ['aws']) do
|
|||
tests('#disassociate_route_table').raises(ArgumentError) do
|
||||
Fog::Compute[:aws].disassociate_route_table
|
||||
end
|
||||
tests("#disassociate_route_table('rtbassoc-00000000')").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#disassociate_route_table('rtbassoc-00000000')").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].disassociate_route_table('rtbassoc-00000000')
|
||||
end
|
||||
|
||||
|
@ -312,14 +312,14 @@ Shindo.tests('Fog::Compute[:aws] | route table requests', ['aws']) do
|
|||
tests('#delete_route_table').raises(ArgumentError) do
|
||||
Fog::Compute[:aws].delete_route_table
|
||||
end
|
||||
tests("#delete_route_table('rtb-00000000')").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#delete_route_table('rtb-00000000')").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].delete_route_table('rtb-00000000')
|
||||
end
|
||||
|
||||
# Dependency Tests
|
||||
# - route is depending on route_table, so route_table cannot be deleted
|
||||
#
|
||||
tests("#delete_route_table('#{@route_table_id}')").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#delete_route_table('#{@route_table_id}')").raises(Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].delete_route_table(@route_table_id)
|
||||
end
|
||||
|
||||
|
|
|
@ -318,11 +318,11 @@ Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
|
|||
@security_group = Fog::Compute[:aws].security_groups.create(:description => 'tests group', :name => 'fog_security_group')
|
||||
@other_security_group = Fog::Compute[:aws].security_groups.create(:description => 'tests group', :name => 'fog_other_security_group')
|
||||
|
||||
tests("duplicate #create_security_group(#{@security_group.name}, #{@security_group.description})").raises(Fog::Compute::AWS::Error) do
|
||||
tests("duplicate #create_security_group(#{@security_group.name}, #{@security_group.description})").raises(Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].create_security_group(@security_group.name, @security_group.description)
|
||||
end
|
||||
|
||||
tests("#authorize_security_group_ingress('not_a_group_name', {'FromPort' => 80, 'IpProtocol' => 'tcp', 'toPort' => 80})").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#authorize_security_group_ingress('not_a_group_name', {'FromPort' => 80, 'IpProtocol' => 'tcp', 'toPort' => 80})").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].authorize_security_group_ingress(
|
||||
'not_a_group_name',
|
||||
{
|
||||
|
@ -333,7 +333,7 @@ Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
|
|||
)
|
||||
end
|
||||
|
||||
tests("#authorize_security_group_ingress('not_a_group_name', {'SourceSecurityGroupName' => 'not_a_group_name', 'SourceSecurityGroupOwnerId' => '#{@owner_id}'})").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#authorize_security_group_ingress('not_a_group_name', {'SourceSecurityGroupName' => 'not_a_group_name', 'SourceSecurityGroupOwnerId' => '#{@owner_id}'})").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].authorize_security_group_ingress(
|
||||
'not_a_group_name',
|
||||
{
|
||||
|
@ -347,7 +347,7 @@ Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
|
|||
Fog::Compute[:aws].authorize_security_group_ingress('fog_security_group', {'IpPermissions' => [{'IpProtocol' => 'tcp', 'FromPort' => 80, 'ToPort' => 80, 'IpRanges' => [{'CidrIp' => '10.0.0.0/8'}]}]}).body
|
||||
end
|
||||
|
||||
tests("#authorize_security_group_ingress('fog_security_group', {'IpPermissions' => [{'IpProtocol' => 'tcp', 'FromPort' => 80, 'ToPort' => 80, 'IpRanges' => [{'CidrIp' => '10.0.0.0/8'}]}]})").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#authorize_security_group_ingress('fog_security_group', {'IpPermissions' => [{'IpProtocol' => 'tcp', 'FromPort' => 80, 'ToPort' => 80, 'IpRanges' => [{'CidrIp' => '10.0.0.0/8'}]}]})").raises(Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].authorize_security_group_ingress('fog_security_group', {'IpPermissions' => [{'IpProtocol' => 'tcp', 'FromPort' => 80, 'ToPort' => 80, 'IpRanges' => [{'CidrIp' => '10.0.0.0/8'}]}]})
|
||||
end
|
||||
|
||||
|
@ -355,7 +355,7 @@ Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
|
|||
Fog::Compute[:aws].authorize_security_group_ingress('fog_security_group', {'IpPermissions' => [{'Groups' => [{'GroupName' => @other_security_group.name}], 'FromPort' => 80, 'ToPort' => 80, 'IpProtocol' => 'tcp'}]}).body
|
||||
end
|
||||
|
||||
tests("#delete_security_group('#{@other_security_group.name}')").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#delete_security_group('#{@other_security_group.name}')").raises(Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].delete_security_group(@other_security_group.name)
|
||||
end
|
||||
|
||||
|
@ -374,16 +374,16 @@ Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
|
|||
]
|
||||
|
||||
broken_params.each do |broken_params_item|
|
||||
tests("#authorize_security_group_ingress('fog_security_group', #{broken_params_item.inspect})").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#authorize_security_group_ingress('fog_security_group', #{broken_params_item.inspect})").raises(Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].authorize_security_group_ingress('fog_security_group', broken_params_item)
|
||||
end
|
||||
|
||||
tests("#revoke_security_group_ingress('fog_security_group', #{broken_params_item.inspect})").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#revoke_security_group_ingress('fog_security_group', #{broken_params_item.inspect})").raises(Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].revoke_security_group_ingress('fog_security_group', broken_params_item)
|
||||
end
|
||||
end
|
||||
|
||||
tests("#revoke_security_group_ingress('not_a_group_name', {'FromPort' => 80, 'IpProtocol' => 'tcp', 'toPort' => 80})").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#revoke_security_group_ingress('not_a_group_name', {'FromPort' => 80, 'IpProtocol' => 'tcp', 'toPort' => 80})").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].revoke_security_group_ingress(
|
||||
'not_a_group_name',
|
||||
{
|
||||
|
@ -394,7 +394,7 @@ Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
|
|||
)
|
||||
end
|
||||
|
||||
tests("#revoke_security_group_ingress('not_a_group_name', {'SourceSecurityGroupName' => 'not_a_group_name', 'SourceSecurityGroupOwnerId' => '#{@owner_id}'})").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#revoke_security_group_ingress('not_a_group_name', {'SourceSecurityGroupName' => 'not_a_group_name', 'SourceSecurityGroupOwnerId' => '#{@owner_id}'})").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].revoke_security_group_ingress(
|
||||
'not_a_group_name',
|
||||
{
|
||||
|
@ -404,13 +404,13 @@ Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
|
|||
)
|
||||
end
|
||||
|
||||
tests("#delete_security_group('not_a_group_name')").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#delete_security_group('not_a_group_name')").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].delete_security_group('not_a_group_name')
|
||||
end
|
||||
|
||||
@rds_security_group = Fog::AWS[:rds].security_groups.create(:id => "rdsgroup", :description => 'fog rds test')
|
||||
|
||||
tests("#delete_security_group('when authorized to an rds firewall')").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#delete_security_group('when authorized to an rds firewall')").raises(Fog::AWS::Compute::Error) do
|
||||
@rds_security_group.authorize_ec2_security_group(@security_group.name)
|
||||
Fog::Compute[:aws].delete_security_group(@security_group.name)
|
||||
end
|
||||
|
@ -420,7 +420,7 @@ Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
|
|||
@security_group.destroy
|
||||
@other_security_group.destroy
|
||||
|
||||
tests("#delete_security_group('default')").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#delete_security_group('default')").raises(Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].delete_security_group('default')
|
||||
end
|
||||
|
||||
|
@ -432,11 +432,11 @@ Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
|
|||
]
|
||||
|
||||
broken_params.each do |list_elem|
|
||||
tests("#authorize_security_group_ingress(#{list_elem[0].inspect}, #{list_elem[1].inspect})").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#authorize_security_group_ingress(#{list_elem[0].inspect}, #{list_elem[1].inspect})").raises(Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].authorize_security_group_ingress(list_elem[0], list_elem[1])
|
||||
end
|
||||
|
||||
tests("#revoke_security_group_ingress(#{list_elem[0].inspect}, #{list_elem[1].inspect})").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#revoke_security_group_ingress(#{list_elem[0].inspect}, #{list_elem[1].inspect})").raises(Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].revoke_security_group_ingress(list_elem[0], list_elem[1])
|
||||
end
|
||||
end
|
||||
|
|
|
@ -66,7 +66,7 @@ Shindo.tests('Fog::Compute[:aws] | snapshot requests', ['aws']) do
|
|||
end
|
||||
tests('failure') do
|
||||
|
||||
tests("#delete_snapshot('snap-00000000')").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#delete_snapshot('snap-00000000')").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].delete_snapshot('snap-00000000')
|
||||
end
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ Shindo.tests('Fog::Compute[:aws] | spot datafeed subscription requests', ['aws']
|
|||
tests('failure') do
|
||||
pending if Fog.mocking?
|
||||
|
||||
tests("#describe_spot_datafeed_subscription").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#describe_spot_datafeed_subscription").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].describe_spot_datafeed_subscription
|
||||
end
|
||||
end
|
||||
|
|
|
@ -67,17 +67,17 @@ Shindo.tests('Fog::Compute[:aws] | subnet requests', ['aws']) do
|
|||
end
|
||||
|
||||
tests('failure') do
|
||||
tests("#create_subnet('vpc-00000000', '10.0.10.0/16')").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#create_subnet('vpc-00000000', '10.0.10.0/16')").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].create_subnet('vpc-00000000', '10.0.10.0/16')
|
||||
end
|
||||
|
||||
tests("#create_subnet('#{@vpc_id}', '10.0.9.16/28')").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#create_subnet('#{@vpc_id}', '10.0.9.16/28')").raises(Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].create_subnet(@vpc_id, '10.0.9.16/28')
|
||||
end
|
||||
|
||||
# Attempt to create two subnets with conflicting CIDRs in the same VPC
|
||||
tests("#create_subnet('#{@vpc_id}', '10.0.10.0/24'); " \
|
||||
"#create_subnet('#{@vpc_id}', '10.0.10.64/26'); ").raises(::Fog::Compute::AWS::Error) do
|
||||
"#create_subnet('#{@vpc_id}', '10.0.10.64/26'); ").raises(::Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].create_subnet(@vpc_id, '10.0.10.0/24')
|
||||
Fog::Compute[:aws].create_subnet(@vpc_id, '10.0.10.64/26')
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Shindo.tests('Fog::Compute[:aws] | tag requests', ['aws']) do
|
||||
Fog::Compute::AWS::Mock.reset if Fog.mocking?
|
||||
Fog::AWS::Compute::Mock.reset if Fog.mocking?
|
||||
|
||||
@tags_format = {
|
||||
'tagSet' => [{
|
||||
|
@ -18,7 +18,7 @@ Shindo.tests('Fog::Compute[:aws] | tag requests', ['aws']) do
|
|||
|
||||
tests('success') do
|
||||
if Fog.mocking?
|
||||
@other_account = Fog::Compute::AWS.new(:aws_access_key_id => 'other', :aws_secret_access_key => 'account')
|
||||
@other_account = Fog::AWS::Compute.new(:aws_access_key_id => 'other', :aws_secret_access_key => 'account')
|
||||
@image_id = Fog::Compute[:aws].register_image('image', 'image', '/dev/sda1').body['imageId']
|
||||
end
|
||||
|
||||
|
@ -97,5 +97,5 @@ Shindo.tests('Fog::Compute[:aws] | tag requests', ['aws']) do
|
|||
Fog::Compute[:aws].create_tags('vpc-123', 'type' => 'bad_resource_id')
|
||||
end
|
||||
end
|
||||
Fog::Compute::AWS::Mock.reset if Fog.mocking?
|
||||
Fog::AWS::Compute::Mock.reset if Fog.mocking?
|
||||
end
|
||||
|
|
|
@ -207,52 +207,52 @@ Shindo.tests('Fog::Compute[:aws] | volume requests', ['aws']) do
|
|||
tests('failure') do
|
||||
@volume = Fog::Compute[:aws].volumes.create(:availability_zone => @server.availability_zone, :size => 1)
|
||||
|
||||
tests("#attach_volume('i-00000000', '#{@volume.identity}', '/dev/sdh')").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#attach_volume('i-00000000', '#{@volume.identity}', '/dev/sdh')").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].attach_volume('i-00000000', @volume.identity, '/dev/sdh')
|
||||
end
|
||||
|
||||
tests("#attach_volume('#{@server.identity}', 'vol-00000000', '/dev/sdh')").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#attach_volume('#{@server.identity}', 'vol-00000000', '/dev/sdh')").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].attach_volume(@server.identity, 'vol-00000000', '/dev/sdh')
|
||||
end
|
||||
|
||||
tests("#detach_volume('vol-00000000')").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#detach_volume('vol-00000000')").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].detach_volume('vol-00000000')
|
||||
end
|
||||
|
||||
tests("#modify_volume_attribute('vol-00000000', true)").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#modify_volume_attribute('vol-00000000', true)").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].modify_volume_attribute('vol-00000000', true)
|
||||
end
|
||||
|
||||
tests("#detach_volume('#{@volume.identity}')").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#detach_volume('#{@volume.identity}')").raises(Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].detach_volume(@volume.identity)
|
||||
end
|
||||
|
||||
tests("#delete_volume('vol-00000000')").raises(Fog::Compute::AWS::NotFound) do
|
||||
tests("#delete_volume('vol-00000000')").raises(Fog::AWS::Compute::NotFound) do
|
||||
Fog::Compute[:aws].delete_volume('vol-00000000')
|
||||
end
|
||||
|
||||
# Iops required
|
||||
tests("#create_volume('#{@server.availability_zone}', 10, 'VolumeType' => 'io1')").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#create_volume('#{@server.availability_zone}', 10, 'VolumeType' => 'io1')").raises(Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].create_volume(@server.availability_zone, 10, 'VolumeType' => 'io1')
|
||||
end
|
||||
|
||||
# size too small for iops
|
||||
tests("#create_volume('#{@server.availability_zone}', 9, 'VolumeType' => 'io1', 'Iops' => 100)").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#create_volume('#{@server.availability_zone}', 9, 'VolumeType' => 'io1', 'Iops' => 100)").raises(Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].create_volume(@server.availability_zone, 9, 'VolumeType' => 'io1', 'Iops' => 100)
|
||||
end
|
||||
|
||||
# iops:size ratio too big
|
||||
tests("#create_volume('#{@server.availability_zone}', 10, 'VolumeType' => 'io1', 'Iops' => 301)").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#create_volume('#{@server.availability_zone}', 10, 'VolumeType' => 'io1', 'Iops' => 301)").raises(Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].create_volume(@server.availability_zone, 10, 'VolumeType' => 'io1', 'Iops' => 301)
|
||||
end
|
||||
|
||||
# iops invalid value (lower than 100)
|
||||
tests("#create_volume('#{@server.availability_zone}', 10, 'VolumeType' => 'io1', 'Iops' => 99)").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#create_volume('#{@server.availability_zone}', 10, 'VolumeType' => 'io1', 'Iops' => 99)").raises(Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].create_volume(@server.availability_zone, 10, 'VolumeType' => 'io1', 'Iops' => 99)
|
||||
end
|
||||
|
||||
# iops invalid value (greater than 4000)
|
||||
tests("#create_volume('#{@server.availability_zone}', 1024, 'VolumeType' => 'io1', 'Iops' => 4001)").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#create_volume('#{@server.availability_zone}', 1024, 'VolumeType' => 'io1', 'Iops' => 4001)").raises(Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].create_volume(@server.availability_zone, 1024, 'VolumeType' => 'io1', 'Iops' => 4001)
|
||||
end
|
||||
|
||||
|
|
|
@ -104,11 +104,11 @@ Shindo.tests('Fog::Compute[:aws] | vpc requests', ['aws']) do
|
|||
Fog::Compute[:aws].describe_vpc_attribute(@vpc_id, 'enableDnsHostnames').body["enableDnsHostnames"]
|
||||
end
|
||||
|
||||
tests("#modify_vpc_attribute('#{@vpc_id}')").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#modify_vpc_attribute('#{@vpc_id}')").raises(Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].modify_vpc_attribute(@vpc_id).body
|
||||
end
|
||||
|
||||
tests("#modify_vpc_attribute('#{@vpc_id}', {'EnableDnsSupport.Value' => true, 'EnableDnsHostnames.Value' => true})").raises(Fog::Compute::AWS::Error) do
|
||||
tests("#modify_vpc_attribute('#{@vpc_id}', {'EnableDnsSupport.Value' => true, 'EnableDnsHostnames.Value' => true})").raises(Fog::AWS::Compute::Error) do
|
||||
Fog::Compute[:aws].modify_vpc_attribute(@vpc_id, {'EnableDnsSupport.Value' => true, 'EnableDnsHostnames.Value' => true}).body
|
||||
end
|
||||
|
||||
|
@ -211,6 +211,6 @@ Shindo.tests('Fog::Compute[:aws] | vpc requests', ['aws']) do
|
|||
# Clean up
|
||||
Fog::Compute[:aws].delete_tags(@another_vpc.id, test_tags)
|
||||
@another_vpc.destroy
|
||||
Fog::Compute::AWS::Mock.reset if Fog.mocking?
|
||||
Fog::AWS::Compute::Mock.reset if Fog.mocking?
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue