Sha256: b0108c5ae5f697ec8c02a711fff7a1ad4d88bfb8848c802629bb0b6aeefedd1c

Contents?: true

Size: 1.58 KB

Versions: 53

Compression:

Stored size: 1.58 KB

Contents

Shindo.tests('Fog::Compute[:cloudsigma] | volume requests', ['cloudsigma']) do

  @volume_format = {
      'uuid' => String,
      'size' => Integer,
      'status' => String,
      'name' => String,
      'tags' => Array,
      'meta' => Fog::Nullable::Hash,
      'owner' => Fog::Nullable::Hash,
      'resource_uri' => Fog::Nullable::String,
      'licenses' => Array,
      'jobs' => Array,
      'affinities' => Array,
      'mounted_on' => Array,
      'media' => String,
      'allow_multimount' => Fog::Boolean
  }

  @volume_create_args = {:name => 'fogtest', :size => 1024**3, :media => :cdrom}

  tests('success') do

    tests("#create_volume(#@volume_create_args)").formats(@volume_format, false) do
      @resp_volume = Fog::Compute[:cloudsigma].create_volume(@volume_create_args).body['objects'].first
      @volume_uuid = @resp_volume['uuid']

      @resp_volume
    end

    volume = Fog::Compute[:cloudsigma].volumes.get(@volume_uuid)
    volume.wait_for { status == 'unmounted' }

    tests("#update_volume(#@volume_uuid)").formats(@volume_format, false) do
      @resp_volume['media'] = 'disk'
      @resp_volume = Fog::Compute[:cloudsigma].update_volume(@volume_uuid, @resp_volume).body

      @resp_volume
    end

    tests("#delete_volume(#@volume_uuid)").succeeds do
      resp = Fog::Compute[:cloudsigma].delete_volume(@volume_uuid)

      resp.body.empty? && resp.status == 204
    end

  end

  tests('failure') do
    tests("#get_volume(#@server_uuid)|deleted|").raises(Fog::CloudSigma::Errors::NotFound) do
      Fog::Compute[:cloudsigma].get_volume(@volume_uuid).body
    end
  end

end

Version data entries

53 entries across 53 versions & 3 rubygems

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