Sha256: 8a6c25630c4a494cf17c17d2d2a7857c98ba1e48bf82f5adda68e93260975807

Contents?: true

Size: 1.71 KB

Versions: 16

Compression:

Stored size: 1.71 KB

Contents

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

  pending if Fog.mocking?
  model_tests(Fog::AWS[:rds].security_groups, params, false) 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
      @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

    @instance.wait_for { ready? }
    tests("#revoke_cidrip").succeeds do
      @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

16 entries across 16 versions & 4 rubygems

Version Path
brightbox-cli-0.17.4 lib/brightbox-cli/vendor/fog/tests/aws/models/rds/security_group_tests.rb
brightbox-cli-0.17.3 lib/brightbox-cli/vendor/fog/tests/aws/models/rds/security_group_tests.rb
brightbox-cli-0.17.2 lib/brightbox-cli/vendor/fog/tests/aws/models/rds/security_group_tests.rb
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/tests/aws/models/rds/security_group_tests.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/tests/aws/models/rds/security_group_tests.rb
fog-1.1.2 tests/aws/models/rds/security_group_tests.rb
fog_tractical-1.1.4 tests/aws/models/rds/security_group_tests.rb
fog_tractical-1.1.3 tests/aws/models/rds/security_group_tests.rb
brightbox-cli-0.16.0 lib/brightbox-cli/vendor/fog/tests/aws/models/rds/security_group_tests.rb
fog-1.1.1 tests/aws/models/rds/security_group_tests.rb
fog-1.1.0 tests/aws/models/rds/security_group_tests.rb
brightbox-cli-0.15.0 lib/brightbox-cli/vendor/fog/tests/aws/models/rds/security_group_tests.rb
tag-fog-1.0.1 tests/aws/models/rds/security_group_tests.rb
brightbox-cli-0.14.1 lib/brightbox-cli/vendor/fog/tests/aws/models/rds/security_group_tests.rb
brightbox-cli-0.14.0 lib/brightbox-cli/vendor/fog/tests/aws/models/rds/security_group_tests.rb
fog-1.0.0 tests/aws/models/rds/security_group_tests.rb