Sha256: d1e6d9e44fe85ad5fe811798978ccd6d6f7ef097fc92c884fd23a7380d1e3a53

Contents?: true

Size: 1.63 KB

Versions: 25

Compression:

Stored size: 1.63 KB

Contents

Shindo.tests("AWS::EFS | mount target", ["aws", "efs"]) do
  @file_system = Fog::AWS[:efs].file_systems.create(:creation_token => "fogtoken#{rand(999).to_s}")
  @file_system.wait_for { ready? }

  if Fog.mocking?
    vpc = Fog::Compute[:aws].vpcs.create(:cidr_block => "10.0.0.0/16")
    subnet = Fog::Compute[:aws].subnets.create(:vpc_id => vpc.id, :cidr_block => "10.0.1.0/24")
    default_security_group_data = Fog::Compute[:aws].data[:security_groups].values.find do |sg|
      sg['groupDescription'] == 'default_elb security group'
    end
    default_security_group = Fog::Compute[:aws].security_groups.new(default_security_group_data)
  else
    vpc = Fog::Compute[:aws].vpcs.first
    subnet = vpc.subnets.first
    default_security_group = Fog::Compute[:aws].security_groups.detect { |sg| sg.description == 'default VPC security group' }
  end

  security_group = Fog::Compute[:aws].security_groups.create(
    :vpc_id      => vpc.id,
    :name        => "fog#{rand(999).to_s}",
    :description => "fog#{rand(999).to_s}"
  )

  mount_target_params = {
    :file_system_id  => @file_system.identity,
    :subnet_id       => subnet.identity,
  }

  model_tests(Fog::AWS[:efs].mount_targets, mount_target_params, true) do
    @instance.wait_for { ready? }

    tests("#security_groups") do
      returns([default_security_group.group_id]) { @instance.security_groups }
    end

    tests("#security_groups=") do
      @instance.security_groups = [security_group.group_id]
      returns([security_group.group_id]) { @instance.security_groups }
    end
  end

  @file_system.wait_for { number_of_mount_targets == 0 }
  @file_system.destroy
  security_group.destroy
end

Version data entries

25 entries across 23 versions & 2 rubygems

Version Path
fog-aws-3.12.0 tests/models/efs/mount_target_tests.rb
fog-aws-3.11.0 tests/models/efs/mount_target_tests.rb
fog-aws-3.10.0 tests/models/efs/mount_target_tests.rb
fog-aws-3.9.0 tests/models/efs/mount_target_tests.rb
fog-aws-3.8.0 tests/models/efs/mount_target_tests.rb
fog-aws-3.7.0 tests/models/efs/mount_target_tests.rb
fog-aws-3.6.7 tests/models/efs/mount_target_tests.rb
fog-aws-3.6.6 tests/models/efs/mount_target_tests.rb
fog-aws-3.6.5 tests/models/efs/mount_target_tests.rb
fog-aws-3.6.4 tests/models/efs/mount_target_tests.rb
fog-aws-3.6.3 tests/models/efs/mount_target_tests.rb
fog-aws-3.6.2 tests/models/efs/mount_target_tests.rb
fog-aws-3.5.2 tests/models/efs/mount_target_tests.rb
fog-aws-3.5.1 tests/models/efs/mount_target_tests.rb
fog-aws-3.5.0 tests/models/efs/mount_target_tests.rb
fog-aws-3.4.0 tests/models/efs/mount_target_tests.rb
fog-aws-3.3.0 tests/models/efs/mount_target_tests.rb
fog-aws-3.2.0 tests/models/efs/mount_target_tests.rb
fog-aws-3.1.0 tests/models/efs/mount_target_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-aws-2.0.1/tests/models/efs/mount_target_tests.rb