2011-06-16 16:28:54 -07:00
|
|
|
Shindo.tests("Fog::Compute[:aws] | security_group", ['aws']) do
|
2011-03-21 16:45:52 -07:00
|
|
|
|
2011-06-16 16:28:54 -07:00
|
|
|
model_tests(Fog::Compute[:aws].security_groups, {:description => 'foggroupdescription', :name => 'foggroupname'}, true)
|
2011-03-21 16:45:52 -07:00
|
|
|
|
2011-04-19 15:48:40 -04:00
|
|
|
tests("a group with trailing whitespace") do
|
2011-06-16 16:28:54 -07:00
|
|
|
@group = Fog::Compute[:aws].security_groups.create(:name => "foggroup with spaces ", :description => " fog group desc ")
|
2011-04-19 15:48:40 -04:00
|
|
|
test("name is correct") do
|
|
|
|
@group.name == "foggroup with spaces "
|
|
|
|
end
|
|
|
|
|
|
|
|
test("description is correct") do
|
|
|
|
@group.description == " fog group desc "
|
|
|
|
end
|
|
|
|
|
2011-08-23 11:47:30 -07:00
|
|
|
@other_group = Fog::Compute[:aws].security_groups.create(:name => 'other group', :description => 'another group')
|
|
|
|
|
|
|
|
test("authorize access by another security group") do
|
2011-08-23 16:19:49 -07:00
|
|
|
@group.authorize_group_and_owner(@other_group.name)
|
2011-08-23 11:47:30 -07:00
|
|
|
@group.reload
|
|
|
|
@group.ip_permissions.size == 3
|
|
|
|
end
|
|
|
|
|
|
|
|
test("revoke access from another security group") do
|
2011-08-23 16:19:49 -07:00
|
|
|
@group.revoke_group_and_owner(@other_group.name)
|
2011-08-23 11:47:30 -07:00
|
|
|
@group.reload
|
2011-08-23 12:09:55 -07:00
|
|
|
@group.ip_permissions.empty?
|
2011-08-23 11:47:30 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
@other_group.destroy
|
2011-04-19 15:48:40 -04:00
|
|
|
@group.destroy
|
|
|
|
end
|
2011-03-21 16:45:52 -07:00
|
|
|
end
|