Sha256: 0c18622d00160419d40f430b45177b813213be3f9bd52476f288060ec390174f

Contents?: true

Size: 1.64 KB

Versions: 91

Compression:

Stored size: 1.64 KB

Contents

Shindo.tests('HP::BlockStorage | snapshot requests', ['hp', 'block_storage', 'snapshots']) do

  @snapshot_format = {
    'status'             => String,
    'displayDescription' => Fog::Nullable::String,
    'displayName'        => Fog::Nullable::String,
    'volumeId'           => Integer,
    'size'               => Integer,
    'id'                 => Integer,
    'createdAt'          => String
  }

  tests('success') do

    @snapshot_id = nil
    @snapshot_name = "fogsnapshottests"
    @snapshot_desc = @snapshot_name + " desc"

    @volume = HP[:block_storage].volumes.create(:name => 'fogvolforsnap', :size => 1)
    @volume.wait_for { ready? }

    tests("#create_snapshot(#{@snapshot_name}, #{@snapshot_desc}, #{@volume.id})").formats(@snapshot_format) do
      data = HP[:block_storage].create_snapshot(@snapshot_name, @snapshot_desc, @volume.id).body['snapshot']
      @snapshot_id = data['id']
      data
    end

    tests("#get_snapshot_details(#{@snapshot_id})").formats(@snapshot_format) do
      HP[:block_storage].get_snapshot_details(@snapshot_id).body['snapshot']
    end

    tests('#list_snapshots').formats({'snapshots' => [@snapshot_format]}) do
      HP[:block_storage].list_snapshots.body
    end

    tests("#delete_snapshot(#{@snapshot_id})").succeeds do
      HP[:block_storage].delete_snapshot(@snapshot_id)
    end

  end

  tests('failure') do

    tests('#get_snapshot_details(0)').raises(Fog::HP::BlockStorage::NotFound) do
      HP[:block_storage].get_snapshot_details(0)
    end

    tests("#delete_snapshot(0)").raises(Fog::HP::BlockStorage::NotFound) do
      HP[:block_storage].delete_snapshot(0)
    end

  end

  @volume.destroy

end

Version data entries

91 entries across 91 versions & 9 rubygems

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