Sha256: e5cfbed2e7640d829067fbe99403b10e6eccad74fdfdac9ff9d3700f8cea8945

Contents?: true

Size: 1.34 KB

Versions: 12

Compression:

Stored size: 1.34 KB

Contents

provider, config = :ecloud, compute_providers[:ecloud]

Shindo.tests("Fog::Compute[:#{provider}] | server", [provider.to_s, "attributes"]) do
  connection   = Fog::Compute[provider]
  connection.base_path = '/cloudapi/spec'
  organization = connection.organizations.first
  environment  = organization.environments.find{|e| e.name == config[:server_attributes][:environment_name]} || organization.environments.first
  public_ip    = environment.public_ips.first
  compute_pool = environment.compute_pools.first
  image_href   = Fog.credentials[:ecloud_image_href] || compute_pool.templates.first.href
  ssh_key      = organization.admin.ssh_keys.find { |key| key.name == "root" }

  @network = environment.networks.first
  options = config[:server_attributes].merge(:network_uri => @network.href, :ssh_key_uri => ssh_key.href)
  #if Fog.credentials[:ecloud_ssh_key_id]
  #  options = options.merge(:ssh_key_uri => "/cloudapi/ecloud/admin/sshkeys/#{Fog.credentials[:ecloud_ssh_key_id]}")
  #end

  @server = compute_pool.servers.first || compute_pool.servers.create(image_href, options).tap{|s| s.wait_for { ready? }}

  tests('#ip_addresses').succeeds do
    returns(true, "is an array") { @server.ips.is_a?(Array) }
    returns(true, "contains an VirtualMachineAssignedIp") { @server.ips.all?{|ip| ip.is_a?(Fog::Compute::Ecloud::VirtualMachineAssignedIp) } }
  end
end

Version data entries

12 entries across 10 versions & 3 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-ecloud-0.3.0/tests/compute/models/server_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-ecloud-0.3.0/tests/compute/models/server_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-ecloud-0.3.0/tests/compute/models/server_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-ecloud-0.1.1/tests/compute/models/server_tests.rb
fog-ecloud-0.3.0 tests/compute/models/server_tests.rb
fog-ecloud-0.2.0 tests/compute/models/server_tests.rb
fog-ecloud-0.1.3 tests/compute/models/server_tests.rb
fog-ecloud-0.1.2 tests/compute/models/server_tests.rb
fog-ecloud-0.1.1 tests/compute/models/server_tests.rb
fog-ecloud-0.1.0 tests/compute/models/server_tests.rb
fog-ecloud-0.0.2 tests/compute/models/server_tests.rb
fog-ecloud-0.0.1 tests/compute/models/server_tests.rb