Sha256: 7a918fa75f715c08034d743c947150d34aa3af64c55dbe4fd5e1508d04520259

Contents?: true

Size: 1.79 KB

Versions: 75

Compression:

Stored size: 1.79 KB

Contents

Shindo.tests('Fog::Compute[:serverlove] | drive requests', ['serverlove']) do

  @image_format = {
    'drive'             => String,
    'name'              => String,
    'user'              => String,
    'size'              => Integer,
    'claimed'           => Fog::Nullable::String,
    'status'            => String,
    'encryption:cipher' => String,
    'read:bytes'        => String,
    'write:bytes'       => String,
    'read:requests'     => String,
    'write:requests'    => String
  }
  
  tests('success') do

    attributes = { 'name' => 'Test', 'size' => '24234567890' }

    tests("#create_image").formats(@image_format) do
      @image = Fog::Compute[:serverlove].create_image(attributes).body
    end
    
    tests("#list_images").succeeds do
      Fog::Compute[:serverlove].images
    end
    
    tests("#update_image").returns(true) do
      @image['name'] = "Diff"
      Fog::Compute[:serverlove].update_image(@image['drive'], { :name => @image['name'], :size => @image['size']})
      Fog::Compute[:serverlove].images.get(@image['drive']).name == "Diff"
    end
    
    tests("#load_standard_image").returns(true) do
      # Load centos
      Fog::Compute[:serverlove].load_standard_image(@image['drive'], '88ed067f-d2b8-42ce-a25f-5297818a3b6f')
      Fog::Compute[:serverlove].images.get(@image['drive']).imaging != "" # This will be "x%" when imaging
    end
    
    tests("waits for imaging...").returns(true) do
      while(percent_complete = Fog::Compute[:serverlove].images.get(@image['drive']).imaging)
        sleep(1)
        STDERR.print "#{percent_complete} "
        break if percent_complete.include?("100")
      end
      STDERR.print "100% "
      true
    end
    
    tests("#destroy_image").succeeds do
      Fog::Compute[:serverlove].destroy_image(@image['drive'])
    end

  end

end

Version data entries

75 entries across 75 versions & 10 rubygems

Version Path
fog-1.22.0 tests/serverlove/requests/compute/image_tests.rb
fog-1.21.0 tests/serverlove/requests/compute/image_tests.rb
fog-maestrodev-1.20.0.20140305101839 tests/serverlove/requests/compute/image_tests.rb
fog-maestrodev-1.20.0.20140305101305 tests/serverlove/requests/compute/image_tests.rb
fog-maestrodev-1.19.0.20140212012611 tests/serverlove/requests/compute/image_tests.rb
fog-1.20.0 tests/serverlove/requests/compute/image_tests.rb
fog-maestrodev-1.19.0.20140110004459 tests/serverlove/requests/compute/image_tests.rb
fog-maestrodev-1.19.0.20140110003812 tests/serverlove/requests/compute/image_tests.rb
fog-maestrodev-1.19.0.20140109202555 tests/serverlove/requests/compute/image_tests.rb
fog-maestrodev-1.19.0.20140107192102 tests/serverlove/requests/compute/image_tests.rb
fog-maestrodev-1.19.0.20140107142106 tests/serverlove/requests/compute/image_tests.rb
fog-maestrodev-1.19.0.20131219203941 tests/serverlove/requests/compute/image_tests.rb
fog-maestrodev-1.18.0.20131219193542 tests/serverlove/requests/compute/image_tests.rb
fog-1.19.0 tests/serverlove/requests/compute/image_tests.rb
fog-maestrodev-1.18.0.20131219033443 tests/serverlove/requests/compute/image_tests.rb
fog-maestrodev-1.18.0.20131219032002 tests/serverlove/requests/compute/image_tests.rb
fog-maestrodev-1.18.0.20131219030716 tests/serverlove/requests/compute/image_tests.rb
fog-maestrodev-1.18.0.20131219022322 tests/serverlove/requests/compute/image_tests.rb
fog-maestrodev-1.18.0.20131218202447 tests/serverlove/requests/compute/image_tests.rb
fog-maestrodev-1.18.0.20131209091424 tests/serverlove/requests/compute/image_tests.rb