2011-06-16 19:28:54 -04:00
|
|
|
Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
|
2010-05-22 19:01:45 -04:00
|
|
|
|
2010-05-26 18:22:23 -04:00
|
|
|
@security_groups_format = {
|
|
|
|
'requestId' => String,
|
|
|
|
'securityGroupInfo' => [{
|
|
|
|
'groupDescription' => String,
|
2011-12-18 12:13:12 -05:00
|
|
|
'groupId' => Fog::Nullable::String,
|
2010-05-26 18:22:23 -04:00
|
|
|
'groupName' => String,
|
|
|
|
'ipPermissions' => [{
|
2011-12-23 09:37:13 -05:00
|
|
|
'fromPort' => Fog::Nullable::Integer,
|
|
|
|
'groups' => [{ 'groupName' => Fog::Nullable::String, 'userId' => String }],
|
2010-05-26 18:22:23 -04:00
|
|
|
'ipProtocol' => String,
|
|
|
|
'ipRanges' => [],
|
2011-12-23 09:37:13 -05:00
|
|
|
'toPort' => Fog::Nullable::Integer,
|
2010-05-26 18:22:23 -04:00
|
|
|
}],
|
2011-08-22 16:50:18 -04:00
|
|
|
'ipPermissionsEgress' => [],
|
2011-12-23 09:37:13 -05:00
|
|
|
'ownerId' => String,
|
|
|
|
'vpcId' => Fog::Nullable::String
|
2010-05-26 18:22:23 -04:00
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
2011-06-16 19:28:54 -04:00
|
|
|
@owner_id = Fog::Compute[:aws].describe_security_groups('group-name' => 'default').body['securityGroupInfo'].first['ownerId']
|
2010-05-22 19:01:45 -04:00
|
|
|
|
|
|
|
tests('success') do
|
|
|
|
|
2010-09-09 20:50:38 -04:00
|
|
|
tests("#create_security_group('fog_security_group', 'tests group')").formats(AWS::Compute::Formats::BASIC) do
|
2011-06-16 19:28:54 -04:00
|
|
|
Fog::Compute[:aws].create_security_group('fog_security_group', 'tests group').body
|
2010-05-22 19:01:45 -04:00
|
|
|
end
|
|
|
|
|
2011-10-26 10:08:48 -04:00
|
|
|
tests("#create_security_group('fog_security_group_two', 'tests group')").formats(AWS::Compute::Formats::BASIC) do
|
|
|
|
Fog::Compute[:aws].create_security_group('fog_security_group_two', 'tests group').body
|
|
|
|
end
|
|
|
|
|
|
|
|
to_be_revoked = []
|
|
|
|
expected_permissions = []
|
|
|
|
|
|
|
|
permission = { 'SourceSecurityGroupName' => 'default' }
|
|
|
|
tests("#authorize_security_group_ingress('fog_security_group', #{permission.inspect})").formats(AWS::Compute::Formats::BASIC) do
|
|
|
|
Fog::Compute[:aws].authorize_security_group_ingress('fog_security_group', permission).body
|
|
|
|
end
|
|
|
|
|
|
|
|
to_be_revoked.push([permission, expected_permissions.dup])
|
|
|
|
|
|
|
|
expected_permissions = [
|
|
|
|
{"groups"=>[{"groupName"=>"default", "userId"=>@owner_id}],
|
|
|
|
"fromPort"=>1,
|
|
|
|
"ipRanges"=>[],
|
|
|
|
"ipProtocol"=>"tcp",
|
|
|
|
"toPort"=>65535},
|
|
|
|
{"groups"=>[{"groupName"=>"default", "userId"=>@owner_id}],
|
|
|
|
"fromPort"=>1,
|
|
|
|
"ipRanges"=>[],
|
|
|
|
"ipProtocol"=>"udp",
|
|
|
|
"toPort"=>65535},
|
|
|
|
{"groups"=>[{"groupName"=>"default", "userId"=>@owner_id}],
|
|
|
|
"fromPort"=>-1,
|
|
|
|
"ipRanges"=>[],
|
|
|
|
"ipProtocol"=>"icmp",
|
|
|
|
"toPort"=>-1}
|
|
|
|
]
|
|
|
|
|
|
|
|
tests("#describe_security_groups('group-name' => 'fog_security_group')").returns([]) do
|
|
|
|
array_differences(expected_permissions, Fog::Compute[:aws].describe_security_groups('group-name' => 'fog_security_group').body['securityGroupInfo'].first['ipPermissions'])
|
|
|
|
end
|
|
|
|
|
|
|
|
permission = { 'SourceSecurityGroupName' => 'fog_security_group_two', 'SourceSecurityGroupOwnerId' => @owner_id }
|
|
|
|
tests("#authorize_security_group_ingress('fog_security_group', #{permission.inspect})").formats(AWS::Compute::Formats::BASIC) do
|
|
|
|
Fog::Compute[:aws].authorize_security_group_ingress('fog_security_group', permission).body
|
|
|
|
end
|
|
|
|
|
|
|
|
to_be_revoked.push([permission, expected_permissions.dup])
|
|
|
|
|
|
|
|
expected_permissions = [
|
|
|
|
{"groups"=>
|
|
|
|
[{"userId"=>@owner_id, "groupName"=>"default"},
|
|
|
|
{"userId"=>@owner_id, "groupName"=>"fog_security_group_two"}],
|
|
|
|
"ipRanges"=>[],
|
|
|
|
"ipProtocol"=>"tcp",
|
|
|
|
"fromPort"=>1,
|
|
|
|
"toPort"=>65535},
|
|
|
|
{"groups"=>
|
|
|
|
[{"userId"=>@owner_id, "groupName"=>"default"},
|
|
|
|
{"userId"=>@owner_id, "groupName"=>"fog_security_group_two"}],
|
|
|
|
"ipRanges"=>[],
|
|
|
|
"ipProtocol"=>"udp",
|
|
|
|
"fromPort"=>1,
|
|
|
|
"toPort"=>65535},
|
|
|
|
{"groups"=>
|
|
|
|
[{"userId"=>@owner_id, "groupName"=>"default"},
|
|
|
|
{"userId"=>@owner_id, "groupName"=>"fog_security_group_two"}],
|
|
|
|
"ipRanges"=>[],
|
|
|
|
"ipProtocol"=>"icmp",
|
|
|
|
"fromPort"=>-1,
|
|
|
|
"toPort"=>-1}
|
|
|
|
]
|
|
|
|
|
|
|
|
tests("#describe_security_groups('group-name' => 'fog_security_group')").returns([]) do
|
|
|
|
array_differences(expected_permissions, Fog::Compute[:aws].describe_security_groups('group-name' => 'fog_security_group').body['securityGroupInfo'].first['ipPermissions'])
|
|
|
|
end
|
|
|
|
|
|
|
|
permission = { 'IpProtocol' => 'tcp', 'FromPort' => '22', 'ToPort' => '22' }
|
|
|
|
tests("#authorize_security_group_ingress('fog_security_group', #{permission.inspect})").formats(AWS::Compute::Formats::BASIC) do
|
|
|
|
Fog::Compute[:aws].authorize_security_group_ingress('fog_security_group', permission).body
|
|
|
|
end
|
|
|
|
|
|
|
|
to_be_revoked.push([permission, expected_permissions.dup])
|
|
|
|
|
|
|
|
# previous did nothing
|
|
|
|
tests("#describe_security_groups('group-name' => 'fog_security_group')").returns([]) do
|
|
|
|
array_differences(expected_permissions, Fog::Compute[:aws].describe_security_groups('group-name' => 'fog_security_group').body['securityGroupInfo'].first['ipPermissions'])
|
|
|
|
end
|
|
|
|
|
|
|
|
permission = { 'IpProtocol' => 'tcp', 'FromPort' => '22', 'ToPort' => '22', 'CidrIp' => '10.0.0.0/8' }
|
|
|
|
tests("#authorize_security_group_ingress('fog_security_group', #{permission.inspect})").formats(AWS::Compute::Formats::BASIC) do
|
|
|
|
Fog::Compute[:aws].authorize_security_group_ingress('fog_security_group', permission).body
|
|
|
|
end
|
|
|
|
|
|
|
|
to_be_revoked.push([permission, expected_permissions.dup])
|
|
|
|
|
|
|
|
expected_permissions += [
|
|
|
|
{"groups"=>[],
|
|
|
|
"ipRanges"=>[{"cidrIp"=>"10.0.0.0/8"}],
|
|
|
|
"ipProtocol"=>"tcp",
|
|
|
|
"fromPort"=>22,
|
|
|
|
"toPort"=>22}
|
|
|
|
]
|
|
|
|
|
|
|
|
tests("#describe_security_groups('group-name' => 'fog_security_group')").returns([]) do
|
|
|
|
array_differences(expected_permissions, Fog::Compute[:aws].describe_security_groups('group-name' => 'fog_security_group').body['securityGroupInfo'].first['ipPermissions'])
|
|
|
|
end
|
|
|
|
|
|
|
|
# authorize with nested IpProtocol without IpRanges or Groups does nothing
|
|
|
|
permissions = {
|
|
|
|
'IpPermissions' => [
|
|
|
|
{ 'IpProtocol' => 'tcp', 'FromPort' => '22', 'ToPort' => '22' }
|
|
|
|
]
|
|
|
|
}
|
|
|
|
tests("#authorize_security_group_ingress('fog_security_group', #{permissions.inspect})").formats(AWS::Compute::Formats::BASIC) do
|
|
|
|
Fog::Compute[:aws].authorize_security_group_ingress('fog_security_group', permissions).body
|
|
|
|
end
|
|
|
|
|
|
|
|
to_be_revoked.push([permissions, expected_permissions.dup])
|
|
|
|
|
|
|
|
# previous did nothing
|
|
|
|
tests("#describe_security_groups('group-name' => 'fog_security_group')").returns([]) do
|
|
|
|
array_differences(expected_permissions, Fog::Compute[:aws].describe_security_groups('group-name' => 'fog_security_group').body['securityGroupInfo'].first['ipPermissions'])
|
|
|
|
end
|
|
|
|
|
|
|
|
# authorize with nested IpProtocol with IpRanges
|
|
|
|
permissions = {
|
|
|
|
'IpPermissions' => [
|
2011-03-03 18:44:49 -05:00
|
|
|
{
|
2011-10-26 10:08:48 -04:00
|
|
|
'IpProtocol' => 'tcp', 'FromPort' => '80', 'ToPort' => '80',
|
|
|
|
'IpRanges' => [{ 'CidrIp' => '192.168.0.0/24' }]
|
2011-03-03 18:44:49 -05:00
|
|
|
}
|
2011-10-26 10:08:48 -04:00
|
|
|
]
|
|
|
|
}
|
|
|
|
tests("#authorize_security_group_ingress('fog_security_group', #{permissions.inspect})").formats(AWS::Compute::Formats::BASIC) do
|
|
|
|
Fog::Compute[:aws].authorize_security_group_ingress('fog_security_group', permissions).body
|
2010-05-22 19:01:45 -04:00
|
|
|
end
|
|
|
|
|
2011-10-26 10:08:48 -04:00
|
|
|
to_be_revoked.push([permissions, expected_permissions.dup])
|
|
|
|
|
|
|
|
expected_permissions += [
|
|
|
|
{"groups"=>[],
|
|
|
|
"ipRanges"=>[{"cidrIp"=>"192.168.0.0/24"}],
|
|
|
|
"ipProtocol"=>"tcp",
|
|
|
|
"fromPort"=>80,
|
|
|
|
"toPort"=>80}
|
|
|
|
]
|
|
|
|
|
|
|
|
tests("#describe_security_groups('group-name' => 'fog_security_group')").returns([]) do
|
|
|
|
array_differences(expected_permissions, Fog::Compute[:aws].describe_security_groups('group-name' => 'fog_security_group').body['securityGroupInfo'].first['ipPermissions'])
|
|
|
|
end
|
|
|
|
|
|
|
|
# authorize with nested IpProtocol with Groups
|
|
|
|
permissions = {
|
|
|
|
'IpPermissions' => [
|
2011-03-03 18:44:49 -05:00
|
|
|
{
|
2011-10-26 10:08:48 -04:00
|
|
|
'IpProtocol' => 'tcp', 'FromPort' => '8000', 'ToPort' => '8000',
|
|
|
|
'Groups' => [{ 'GroupName' => 'fog_security_group_two' }]
|
2011-03-03 18:44:49 -05:00
|
|
|
}
|
2011-10-26 10:08:48 -04:00
|
|
|
]
|
|
|
|
}
|
|
|
|
tests("#authorize_security_group_ingress('fog_security_group', #{permissions.inspect})").formats(AWS::Compute::Formats::BASIC) do
|
|
|
|
Fog::Compute[:aws].authorize_security_group_ingress('fog_security_group', permissions).body
|
|
|
|
end
|
|
|
|
|
|
|
|
to_be_revoked.push([permissions, expected_permissions.dup])
|
|
|
|
|
|
|
|
expected_permissions += [
|
|
|
|
{"groups"=>[{"userId"=>@owner_id, "groupName"=>"fog_security_group_two"}],
|
|
|
|
"ipRanges"=>[],
|
|
|
|
"ipProtocol"=>"tcp",
|
|
|
|
"fromPort"=>8000,
|
|
|
|
"toPort"=>8000}
|
|
|
|
]
|
|
|
|
|
|
|
|
tests("#describe_security_groups('group-name' => 'fog_security_group')").returns([]) do
|
|
|
|
array_differences(expected_permissions, Fog::Compute[:aws].describe_security_groups('group-name' => 'fog_security_group').body['securityGroupInfo'].first['ipPermissions'])
|
|
|
|
end
|
|
|
|
|
|
|
|
# authorize with nested IpProtocol with IpRanges and Groups
|
|
|
|
# try integers on this one instead of strings
|
|
|
|
permissions = {
|
|
|
|
'IpPermissions' => [
|
|
|
|
{
|
|
|
|
'IpProtocol' => 'tcp', 'FromPort' => 9000, 'ToPort' => 9000,
|
|
|
|
'IpRanges' => [{ 'CidrIp' => '172.16.0.0/24' }],
|
|
|
|
'Groups' => [{ 'GroupName' => 'fog_security_group_two' }]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
tests("#authorize_security_group_ingress('fog_security_group', #{permissions.inspect})").formats(AWS::Compute::Formats::BASIC) do
|
|
|
|
Fog::Compute[:aws].authorize_security_group_ingress('fog_security_group', permissions).body
|
|
|
|
end
|
|
|
|
|
|
|
|
to_be_revoked.push([permissions, expected_permissions.dup])
|
|
|
|
|
|
|
|
expected_permissions += [
|
|
|
|
{"groups"=>
|
|
|
|
[{"userId"=>@owner_id, "groupName"=>"fog_security_group_two"}],
|
|
|
|
"ipRanges"=>[{"cidrIp"=>"172.16.0.0/24"}],
|
|
|
|
"ipProtocol"=>"tcp",
|
|
|
|
"fromPort"=>9000,
|
|
|
|
"toPort"=>9000}
|
|
|
|
]
|
|
|
|
|
|
|
|
tests("#describe_security_groups('group-name' => 'fog_security_group')").returns([]) do
|
|
|
|
array_differences(expected_permissions, Fog::Compute[:aws].describe_security_groups('group-name' => 'fog_security_group').body['securityGroupInfo'].first['ipPermissions'])
|
2010-05-22 19:01:45 -04:00
|
|
|
end
|
|
|
|
|
2010-05-26 18:22:23 -04:00
|
|
|
tests("#describe_security_groups").formats(@security_groups_format) do
|
2011-06-16 19:28:54 -04:00
|
|
|
Fog::Compute[:aws].describe_security_groups.body
|
2010-05-22 19:01:45 -04:00
|
|
|
end
|
|
|
|
|
2010-10-04 18:46:12 -04:00
|
|
|
tests("#describe_security_groups('group-name' => 'fog_security_group')").formats(@security_groups_format) do
|
2011-06-16 19:28:54 -04:00
|
|
|
Fog::Compute[:aws].describe_security_groups('group-name' => 'fog_security_group').body
|
2010-05-22 19:01:45 -04:00
|
|
|
end
|
|
|
|
|
2011-10-26 10:08:48 -04:00
|
|
|
to_be_revoked.reverse.each do |permission, expected_permissions_after|
|
|
|
|
tests("#revoke_security_group_ingress('fog_security_group', #{permission.inspect})").formats(AWS::Compute::Formats::BASIC) do
|
|
|
|
Fog::Compute[:aws].revoke_security_group_ingress('fog_security_group', permission).body
|
|
|
|
end
|
2010-05-22 19:01:45 -04:00
|
|
|
|
2011-10-26 10:08:48 -04:00
|
|
|
tests("#describe_security_groups('group-name' => 'fog_security_group')").returns([]) do
|
|
|
|
array_differences(expected_permissions_after, Fog::Compute[:aws].describe_security_groups('group-name' => 'fog_security_group').body['securityGroupInfo'].first['ipPermissions'])
|
|
|
|
end
|
2010-05-22 19:01:45 -04:00
|
|
|
end
|
|
|
|
|
2010-09-09 20:50:38 -04:00
|
|
|
tests("#delete_security_group('fog_security_group')").formats(AWS::Compute::Formats::BASIC) do
|
2011-06-16 19:28:54 -04:00
|
|
|
Fog::Compute[:aws].delete_security_group('fog_security_group').body
|
2010-05-22 19:01:45 -04:00
|
|
|
end
|
|
|
|
|
2011-10-26 10:08:48 -04:00
|
|
|
tests("#delete_security_group('fog_security_group_two')").formats(AWS::Compute::Formats::BASIC) do
|
|
|
|
Fog::Compute[:aws].delete_security_group('fog_security_group_two').body
|
|
|
|
end
|
|
|
|
|
2010-05-22 19:01:45 -04:00
|
|
|
end
|
|
|
|
tests('failure') do
|
|
|
|
|
2011-06-16 19:28:54 -04:00
|
|
|
@security_group = Fog::Compute[:aws].security_groups.create(:description => 'tests group', :name => 'fog_security_group')
|
2011-10-26 10:08:48 -04:00
|
|
|
@other_security_group = Fog::Compute[:aws].security_groups.create(:description => 'tests group', :name => 'fog_other_security_group')
|
2010-05-22 19:01:45 -04:00
|
|
|
|
2011-06-16 19:28:54 -04:00
|
|
|
tests("duplicate #create_security_group(#{@security_group.name}, #{@security_group.description})").raises(Fog::Compute::AWS::Error) do
|
|
|
|
Fog::Compute[:aws].create_security_group(@security_group.name, @security_group.description)
|
2010-05-22 19:01:45 -04:00
|
|
|
end
|
|
|
|
|
2011-06-16 19:28:54 -04:00
|
|
|
tests("#authorize_security_group_ingress('not_a_group_name', {'FromPort' => 80, 'IpProtocol' => 'tcp', 'toPort' => 80})").raises(Fog::Compute::AWS::NotFound) do
|
|
|
|
Fog::Compute[:aws].authorize_security_group_ingress(
|
2011-03-03 18:44:49 -05:00
|
|
|
'not_a_group_name',
|
|
|
|
{
|
|
|
|
'FromPort' => 80,
|
|
|
|
'IpProtocol' => 'tcp',
|
|
|
|
'ToPort' => 80,
|
|
|
|
}
|
|
|
|
)
|
2010-05-22 19:01:45 -04:00
|
|
|
end
|
|
|
|
|
2011-06-16 19:28:54 -04:00
|
|
|
tests("#authorize_security_group_ingress('not_a_group_name', {'SourceSecurityGroupName' => 'not_a_group_name', 'SourceSecurityGroupOwnerId' => '#{@owner_id}'})").raises(Fog::Compute::AWS::NotFound) do
|
|
|
|
Fog::Compute[:aws].authorize_security_group_ingress(
|
2011-03-03 18:44:49 -05:00
|
|
|
'not_a_group_name',
|
|
|
|
{
|
|
|
|
'SourceSecurityGroupName' => 'not_a_group_name',
|
|
|
|
'SourceSecurityGroupOwnerId' => @owner_id
|
|
|
|
}
|
|
|
|
)
|
2010-05-22 19:01:45 -04:00
|
|
|
end
|
|
|
|
|
2011-10-26 10:08:48 -04:00
|
|
|
tests("#authorize_security_group_ingress('fog_security_group', {'IpPermissions' => [{'IpProtocol' => 'tcp', 'FromPort' => 80, 'ToPort' => 80, 'IpRanges' => [{'CidrIp' => '10.0.0.0/8'}]}]})").formats(AWS::Compute::Formats::BASIC) 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
|
|
|
|
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
|
|
|
|
|
|
|
|
tests("#authorize_security_group_ingress('fog_security_group', {'IpPermissions' => [{'Groups' => [{'GroupName' => '#{@other_security_group.name}'}], 'FromPort' => 80, 'ToPort' => 80, 'IpProtocol' => 'tcp'}]})").formats(AWS::Compute::Formats::BASIC) 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
|
|
|
|
Fog::Compute[:aws].delete_security_group(@other_security_group.name)
|
|
|
|
end
|
|
|
|
|
2011-10-28 13:59:58 -04:00
|
|
|
broken_params = [
|
|
|
|
{},
|
|
|
|
{ "IpProtocol" => "what" },
|
|
|
|
{ "IpProtocol" => "tcp" },
|
|
|
|
{ "IpProtocol" => "what", "FromPort" => 1, "ToPort" => 1 },
|
|
|
|
]
|
|
|
|
broken_params += broken_params.map do |broken_params_item|
|
|
|
|
{ "IpPermissions" => [broken_params_item] }
|
|
|
|
end
|
|
|
|
broken_params += [
|
|
|
|
{ "IpPermissions" => [] },
|
|
|
|
{ "IpPermissions" => nil }
|
|
|
|
]
|
|
|
|
|
|
|
|
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
|
|
|
|
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
|
|
|
|
Fog::Compute[:aws].revoke_security_group_ingress('fog_security_group', broken_params_item)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-06-16 19:28:54 -04:00
|
|
|
tests("#revoke_security_group_ingress('not_a_group_name', {'FromPort' => 80, 'IpProtocol' => 'tcp', 'toPort' => 80})").raises(Fog::Compute::AWS::NotFound) do
|
|
|
|
Fog::Compute[:aws].revoke_security_group_ingress(
|
2011-03-03 18:44:49 -05:00
|
|
|
'not_a_group_name',
|
|
|
|
{
|
|
|
|
'FromPort' => 80,
|
|
|
|
'IpProtocol' => 'tcp',
|
|
|
|
'ToPort' => 80,
|
|
|
|
}
|
|
|
|
)
|
2010-05-22 19:01:45 -04:00
|
|
|
end
|
|
|
|
|
2011-06-16 19:28:54 -04:00
|
|
|
tests("#revoke_security_group_ingress('not_a_group_name', {'SourceSecurityGroupName' => 'not_a_group_name', 'SourceSecurityGroupOwnerId' => '#{@owner_id}'})").raises(Fog::Compute::AWS::NotFound) do
|
|
|
|
Fog::Compute[:aws].revoke_security_group_ingress(
|
2011-03-03 18:44:49 -05:00
|
|
|
'not_a_group_name',
|
|
|
|
{
|
|
|
|
'SourceSecurityGroupName' => 'not_a_group_name',
|
|
|
|
'SourceSecurityGroupOwnerId' => @owner_id
|
|
|
|
}
|
|
|
|
)
|
2010-05-22 19:01:45 -04:00
|
|
|
end
|
|
|
|
|
2011-06-16 19:28:54 -04:00
|
|
|
tests("#delete_security_group('not_a_group_name')").raises(Fog::Compute::AWS::NotFound) do
|
|
|
|
Fog::Compute[:aws].delete_security_group('not_a_group_name')
|
2010-05-22 19:01:45 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
@security_group.destroy
|
2011-10-26 10:08:48 -04:00
|
|
|
@other_security_group.destroy
|
2010-05-22 19:01:45 -04:00
|
|
|
|
2011-10-26 10:08:48 -04:00
|
|
|
tests("#delete_security_group('default')").raises(Fog::Compute::AWS::Error) do
|
|
|
|
Fog::Compute[:aws].delete_security_group('default')
|
|
|
|
end
|
2010-05-22 19:01:45 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|