Sha256: 3813c17158d3bf95b5aa105d96caec10b38f315f08efc089a7af4d2f5b3aad11

Contents?: true

Size: 1.35 KB

Versions: 101

Compression:

Stored size: 1.35 KB

Contents

Shindo.tests('AWS::Elasticache | security groups', ['aws', 'elasticache']) do
  group_name = 'fog-test'
  description = 'Fog Test'

  pending if Fog.mocking?

  model_tests(
  AWS[:elasticache].security_groups,
  {:id => group_name, :description => description}, false
  ) do

    # An EC2 group to authorize
    ec2_group = Fog::Compute.new(:provider => 'AWS').security_groups.create(
      :name => 'fog-test-elasticache', :description => 'fog test'
    )

    # Reload to get the instance owner_id
    @instance.reload

    tests('#authorize_ec2_group') do
      @instance.authorize_ec2_group(ec2_group.name)
      returns('authorizing') do
        group = @instance.ec2_groups.detect do |g|
          g['EC2SecurityGroupName'] == ec2_group.name
        end
        group['Status']
      end
      returns(false, 'not ready') { @instance.ready? }
    end

    @instance.wait_for { ready? }

    tests('#revoke_ec2_group') do
      @instance.revoke_ec2_group(ec2_group.name)
      returns('revoking') do
        group = @instance.ec2_groups.detect do |g|
          g['EC2SecurityGroupName'] == ec2_group.name
        end
        group['Status']
      end
      returns(false, 'not ready') { @instance.ready? }
    end

    ec2_group.destroy
  end

  collection_tests(
    AWS[:elasticache].security_groups,
    {:id => group_name, :description => description}, false
  )

end

Version data entries

101 entries across 101 versions & 17 rubygems

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