Sha256: f6a1b933130b6b3b244d5e711edc8351f84d03187ce7b2967fa2d867d72c6a26

Contents?: true

Size: 1.74 KB

Versions: 87

Compression:

Stored size: 1.74 KB

Contents

Shindo.tests("AWS::RDS | security_group", ['aws', 'rds']) do
  group_name = 'fog-test'
  params = {:id => group_name, :description => 'fog test'}

  model_tests(Fog::AWS[:rds].security_groups, params) do

    tests("#description").returns('fog test') { @instance.description }

    tests("#authorize_ec2_security_group").succeeds do
      @ec2_sec_group = Fog::Compute[:aws].security_groups.create(:name => 'fog-test', :description => 'fog test')

      @instance.authorize_ec2_security_group(@ec2_sec_group.name)
      returns('authorizing') do
        @instance.ec2_security_groups.detect{|h| h['EC2SecurityGroupName'] == @ec2_sec_group.name}['Status']
      end
    end

    @instance.wait_for { ready? }

    tests("#revoke_ec2_security_group").succeeds do
      pending if Fog.mocking?

      @instance.revoke_ec2_security_group(@ec2_sec_group.name)

      returns('revoking') do
        @instance.ec2_security_groups.detect{|h| h['EC2SecurityGroupName'] == @ec2_sec_group.name}['Status']
      end

      @instance.wait_for { ready? }

      returns(false) { @instance.ec2_security_groups.any?{|h| h['EC2SecurityGroupName'] == @ec2_sec_group.name} }
      @ec2_sec_group.destroy
    end

    tests("#authorize_cidrip").succeeds do
      @cidr = '127.0.0.1/32'
      @instance.authorize_cidrip(@cidr)
      returns('authorizing') { @instance.ip_ranges.detect{|h| h['CIDRIP'] == @cidr}['Status'] }
    end

    tests("#revoke_cidrip").succeeds do
      pending if Fog.mocking?

      @instance.wait_for { ready? }
      @instance.revoke_cidrip(@cidr)
      returns('revoking') { @instance.ip_ranges.detect{|h| h['CIDRIP'] == @cidr}['Status'] }
      @instance.wait_for { ready? }
      returns(false) { @instance.ip_ranges.any?{|h| h['CIDRIP'] == @cidr} }

    end

  end
end

Version data entries

87 entries across 87 versions & 15 rubygems

Version Path
fog-1.22.0 tests/aws/models/rds/security_group_tests.rb
fog-1.21.0 tests/aws/models/rds/security_group_tests.rb
fog-maestrodev-1.20.0.20140305101839 tests/aws/models/rds/security_group_tests.rb
fog-maestrodev-1.20.0.20140305101305 tests/aws/models/rds/security_group_tests.rb
fog-maestrodev-1.19.0.20140212012611 tests/aws/models/rds/security_group_tests.rb
fog-1.20.0 tests/aws/models/rds/security_group_tests.rb
fog-maestrodev-1.19.0.20140110004459 tests/aws/models/rds/security_group_tests.rb
fog-maestrodev-1.19.0.20140110003812 tests/aws/models/rds/security_group_tests.rb
fog-maestrodev-1.19.0.20140109202555 tests/aws/models/rds/security_group_tests.rb
fog-maestrodev-1.19.0.20140107192102 tests/aws/models/rds/security_group_tests.rb
fog-maestrodev-1.19.0.20140107142106 tests/aws/models/rds/security_group_tests.rb
fog-maestrodev-1.19.0.20131219203941 tests/aws/models/rds/security_group_tests.rb
fog-maestrodev-1.18.0.20131219193542 tests/aws/models/rds/security_group_tests.rb
fog-1.19.0 tests/aws/models/rds/security_group_tests.rb
fog-maestrodev-1.18.0.20131219033443 tests/aws/models/rds/security_group_tests.rb
fog-maestrodev-1.18.0.20131219032002 tests/aws/models/rds/security_group_tests.rb
fog-maestrodev-1.18.0.20131219030716 tests/aws/models/rds/security_group_tests.rb
fog-maestrodev-1.18.0.20131219022322 tests/aws/models/rds/security_group_tests.rb
fog-maestrodev-1.18.0.20131218202447 tests/aws/models/rds/security_group_tests.rb
fog-maestrodev-1.18.0.20131209091424 tests/aws/models/rds/security_group_tests.rb