Sha256: 878ef017c9c392fbb916b6d3e814a80d86d8254431eb654a8fc0acce4dc26245

Contents?: true

Size: 1.58 KB

Versions: 30

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

30 entries across 30 versions & 4 rubygems

Version Path
fog-1.38.0 tests/cloudsigma/requests/volumes_tests.rb
fog-1.37.0 tests/cloudsigma/requests/volumes_tests.rb
fog-1.36.0 tests/cloudsigma/requests/volumes_tests.rb
fog-1.35.0 tests/cloudsigma/requests/volumes_tests.rb
fog-2.0.0.pre.0 tests/cloudsigma/requests/volumes_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/cloudsigma/requests/volumes_tests.rb
fog-1.34.0 tests/cloudsigma/requests/volumes_tests.rb
fog-1.33.0 tests/cloudsigma/requests/volumes_tests.rb
fog-1.32.0 tests/cloudsigma/requests/volumes_tests.rb
fog-1.31.0 tests/cloudsigma/requests/volumes_tests.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/cloudsigma/requests/volumes_tests.rb
fog-1.30.0 tests/cloudsigma/requests/volumes_tests.rb
fog-1.29.0 tests/cloudsigma/requests/volumes_tests.rb
fog-1.28.0 tests/cloudsigma/requests/volumes_tests.rb
fog-1.27.0 tests/cloudsigma/requests/volumes_tests.rb
fog-1.26.0 tests/cloudsigma/requests/volumes_tests.rb
fog-1.25.0 tests/cloudsigma/requests/volumes_tests.rb
nsidc-fog-1.24.1 tests/cloudsigma/requests/volumes_tests.rb
fog-1.24.0 tests/cloudsigma/requests/volumes_tests.rb
ns-fog-1.22.11 tests/cloudsigma/requests/volumes_tests.rb