From 7829bb73aada96bbe28ab65c68231c5a27ff3454 Mon Sep 17 00:00:00 2001 From: Dylan Egan Date: Tue, 23 Aug 2011 11:47:30 -0700 Subject: [PATCH] [compute|aws] Simple test to verify revoke_group_and_owner behaviour. --- tests/compute/models/aws/security_group_tests.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/compute/models/aws/security_group_tests.rb b/tests/compute/models/aws/security_group_tests.rb index a2707813c..ac7ce4e25 100644 --- a/tests/compute/models/aws/security_group_tests.rb +++ b/tests/compute/models/aws/security_group_tests.rb @@ -12,6 +12,21 @@ Shindo.tests("Fog::Compute[:aws] | security_group", ['aws']) do @group.description == " fog group desc " end + @other_group = Fog::Compute[:aws].security_groups.create(:name => 'other group', :description => 'another group') + + test("authorize access by another security group") do + @group.authorize_group_and_owner(@other_group.name, @other_group.owner_id) + @group.reload + @group.ip_permissions.size == 3 + end + + test("revoke access from another security group") do + @group.revoke_group_and_owner(@other_group.name, @other_group.owner_id) + @group.reload + @group.ip_permissions.size == 0 + end + + @other_group.destroy @group.destroy end end