Sha256: b74e34ad936936d21f50a8632be301b4cc88661a1e8c4134757a3c80ef1435e6

Contents?: true

Size: 1.73 KB

Versions: 51

Compression:

Stored size: 1.73 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.find{|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.find{|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.find{|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.find{|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

51 entries across 51 versions & 5 rubygems

Version Path
fog-aws-1.2.1 tests/models/rds/security_group_tests.rb
fog-aws-1.2.0 tests/models/rds/security_group_tests.rb
fog-aws-1.1.0 tests/models/rds/security_group_tests.rb
fog-aws-1.0.0 tests/models/rds/security_group_tests.rb
fog-aws-0.13.0 tests/models/rds/security_group_tests.rb
fog-aws-0.12.0 tests/models/rds/security_group_tests.rb
fog-aws-0.11.0 tests/models/rds/security_group_tests.rb
fog-aws-0.10.0 tests/models/rds/security_group_tests.rb
fog-aws-0.9.4 tests/models/rds/security_group_tests.rb
fog-aws-0.9.3 tests/models/rds/security_group_tests.rb
fog-aws-0.9.2 tests/models/rds/security_group_tests.rb
fog-aws-0.9.1 tests/models/rds/security_group_tests.rb
fog-aws-0.9.0 tests/models/rds/security_group_tests.rb
fog-aws-0.8.1 tests/models/rds/security_group_tests.rb
fog-aws-0.8.0 tests/models/rds/security_group_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-aws-0.7.5/tests/models/rds/security_group_tests.rb
fog-aws-0.7.6 tests/models/rds/security_group_tests.rb
fog-aws-0.7.5 tests/models/rds/security_group_tests.rb
fog-aws-0.7.4 tests/models/rds/security_group_tests.rb
fog-aws-0.7.3 tests/models/rds/security_group_tests.rb