Sha256: e8a13e90be823edce1f20f5c0044251b641563dab4b18e5a4d26048409f58710

Contents?: true

Size: 1.1 KB

Versions: 124

Compression:

Stored size: 1.1 KB

Contents

Shindo.tests('Fog::Compute[:ibm] | servers', ['ibm']) do

  tests('success') do

    @name           = "fog-test-instance-" + Time.now.to_i.to_s(32)
    @image_id       = "20010001"
    @instance_type  = "BRZ32.1/2048/60*175"
    @location_id    = "41"
    @key_name       = "fog-test-key-" + Time.now.to_i.to_s(32)
    @key            = Fog::Compute[:ibm].keys.create(:name => @key_name)

    @n_servers   = Fog::Compute[:ibm].servers.length
    @instance_id = Fog::Compute[:ibm].create_instance(@name, @image_id, @instance_type, @location_id, :key_name => @key_name).body["instances"][0]["id"]

    tests('Fog::Compute[:ibm].servers') do
      returns(@n_servers + 1) { Fog::Compute[:ibm].servers.length }
    end

    tests('Fog::Compute[:ibm].servers.get("#{@instance_id}")') do
      @server = Fog::Compute[:ibm].servers.get(@instance_id)
      returns(@instance_id) { @server.id }
    end

    if @server.wait_for(Fog::IBM.timeout) { ready? }
      @server.destroy
    else
      pending
    end
    if @key.wait_for(Fog::IBM.timeout) { instance_ids.empty? }
      @key.destroy
    else
      pending
    end

  end

end

Version data entries

124 entries across 122 versions & 18 rubygems

Version Path
fog-2.3.0 tests/ibm/models/compute/servers_tests.rb
fog-ifeel-2.2.0 tests/ibm/models/compute/servers_tests.rb
fog-2.2.0 tests/ibm/models/compute/servers_tests.rb
fog-2.1.0 tests/ibm/models/compute/servers_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/tests/ibm/models/compute/servers_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/tests/ibm/models/compute/servers_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/tests/ibm/models/compute/servers_tests.rb
fog-1.42.1 tests/ibm/models/compute/servers_tests.rb
fog-2.0.0 tests/ibm/models/compute/servers_tests.rb
fog-1.42.0 tests/ibm/models/compute/servers_tests.rb
fog-1.41.0 tests/ibm/models/compute/servers_tests.rb
fog-1.40.0 tests/ibm/models/compute/servers_tests.rb
fog-1.39.0 tests/ibm/models/compute/servers_tests.rb
fog-1.38.0 tests/ibm/models/compute/servers_tests.rb
fog-1.37.0 tests/ibm/models/compute/servers_tests.rb
fog-1.36.0 tests/ibm/models/compute/servers_tests.rb
fog-1.35.0 tests/ibm/models/compute/servers_tests.rb
fog-2.0.0.pre.0 tests/ibm/models/compute/servers_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/ibm/models/compute/servers_tests.rb
fog-1.34.0 tests/ibm/models/compute/servers_tests.rb