Sha256: 2ed4e96a48bf37fd2067541a67fa2f5ee20ab1867c5f8fcad1ae2f8014a274ac

Contents?: true

Size: 1.9 KB

Versions: 77

Compression:

Stored size: 1.9 KB

Contents

Shindo.tests("Fog::Compute[:aws] | security_group", ['aws']) do

  model_tests(Fog::Compute[:aws].security_groups, {:description => 'foggroupdescription', :name => 'foggroupname'}, true)

  tests("authorize and revoke helpers") do
    @group = Fog::Compute[:aws].security_groups.create(:name => "foggroup", :description => "fog group desc")

    @other_group = Fog::Compute[:aws].security_groups.create(:name => 'fog other group', :description => 'another fog group')
    @other_group.reload

    test("authorize access by another security group") do
      @group.authorize_group_and_owner(@other_group.name)
      @group.reload
      @group.ip_permissions.size == 3
    end

    test("revoke access from another security group") do
      @group.revoke_group_and_owner(@other_group.name)
      @group.reload
      @group.ip_permissions.empty?
    end

    test("authorize access to a port range") do
      @group.authorize_port_range(5000..6000)
      @group.reload
      @group.ip_permissions.size == 1
    end

    test("revoke access to a port range") do
      @group.revoke_port_range(5000..6000)
      @group.reload
      @group.ip_permissions.empty?
    end

    group_forms = [
      "#{@other_group.owner_id}:#{@other_group.group_id}", # deprecated form
      @other_group.group_id,
      {@other_group.owner_id => @other_group.group_id}
    ]

    group_forms.each do |group_arg|
      test("authorize port range access by another security group #{group_arg.inspect}") do
        @other_group.reload
        @group.authorize_port_range(5000..6000, {:group => group_arg})
        @group.reload
        @group.ip_permissions.size == 1
      end

      test("revoke port range access by another security group") do
        @other_group.reload
        @group.revoke_port_range(5000..6000, {:group => group_arg})
        @group.reload
        @group.ip_permissions.empty?
      end
    end

    @other_group.destroy
    @group.destroy
  end
end

Version data entries

77 entries across 77 versions & 11 rubygems

Version Path
fog-maestrodev-1.18.0.20131218202447 tests/aws/models/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131209091424 tests/aws/models/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131209090811 tests/aws/models/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131206115947 tests/aws/models/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131205181604 tests/aws/models/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131127194823 tests/aws/models/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131126183714 tests/aws/models/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131126122111 tests/aws/models/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131125111730 tests/aws/models/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131125083406 tests/aws/models/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131123105121 tests/aws/models/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131122203507 tests/aws/models/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131121075022 tests/aws/models/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131118164830 tests/aws/models/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131115184302 tests/aws/models/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131114200144 tests/aws/models/compute/security_group_tests.rb
gapinc-fog-1.12.1.2.1 tests/aws/models/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131112185232 tests/aws/models/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131111203459 tests/aws/models/compute/security_group_tests.rb
fog-1.18.0 tests/aws/models/compute/security_group_tests.rb