Sha256: 7e178ab68f5de5e215df362d35015a83087d6c6c95ccc04eb32f76aa345ed562

Contents?: true

Size: 1.34 KB

Versions: 16

Compression:

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

16 entries across 16 versions & 4 rubygems

Version Path
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/aws/models/elasticache/security_groups_tests.rb
fog-1.26.0 tests/aws/models/elasticache/security_groups_tests.rb
fog-1.25.0 tests/aws/models/elasticache/security_groups_tests.rb
nsidc-fog-1.24.1 tests/aws/models/elasticache/security_groups_tests.rb
fog-1.24.0 tests/aws/models/elasticache/security_groups_tests.rb
ns-fog-1.22.11 tests/aws/models/elasticache/security_groups_tests.rb
ns-fog-1.22.10 tests/aws/models/elasticache/security_groups_tests.rb
ns-fog-1.22.9 tests/aws/models/elasticache/security_groups_tests.rb
ns-fog-1.22.8 tests/aws/models/elasticache/security_groups_tests.rb
ns-fog-1.22.7 tests/aws/models/elasticache/security_groups_tests.rb
ns-fog-1.22.6 tests/aws/models/elasticache/security_groups_tests.rb
fog-1.23.0 tests/aws/models/elasticache/security_groups_tests.rb
ns-fog-1.22.4 tests/aws/models/elasticache/security_groups_tests.rb
ns-fog-1.22.3 tests/aws/models/elasticache/security_groups_tests.rb
ns-fog-1.22.2 tests/aws/models/elasticache/security_groups_tests.rb
fog-1.22.1 tests/aws/models/elasticache/security_groups_tests.rb