Sha256: af18f123256f21c0e5fa7ca37eb23e1f84f15b2063c04d62005033d5d3ba0f74

Contents?: true

Size: 1.62 KB

Versions: 8

Compression:

Stored size: 1.62 KB

Contents

Shindo.tests('AWS::Compute | snapshot requests', ['aws']) do

  @snapshot_format = {
    'description' => NilClass,
    'ownerId'     => String,
    'progress'    => String,
    'snapshotId'  => String,
    'startTime'   => Time,
    'status'      => String,
    'volumeId'    => String,
    'volumeSize'  => Integer
  }

  @snapshots_format = {
    'requestId'   => String,
    'snapshotSet' => [@snapshot_format]
  }

  @volume = AWS[:compute].volumes.create(:availability_zone => 'us-east-1a', :size => 1)

  tests('success') do

    @snapshot_id = nil

    tests("#create_snapshot(#{@volume.identity})").formats(@snapshot_format.merge('progress' => NilClass, 'requestId' => String)) do
      data = AWS[:compute].create_snapshot(@volume.identity).body
      @snapshot_id = data['snapshotId']
      data
    end

    AWS[:compute].snapshots.get(@snapshot_id).wait_for { ready? }

    tests("#describe_snapshots").formats(@snapshots_format) do
      AWS[:compute].describe_snapshots.body
    end

    tests("#describe_snapshots('#{@snapshot_id}')").formats(@snapshots_format) do
      AWS[:compute].describe_snapshots(@snapshot_id).body
    end

    tests("#delete_snapshots(#{@snapshot_id})").formats(AWS::Compute::Formats::BASIC) do
      AWS[:compute].delete_snapshot(@snapshot_id).body
    end

  end
  tests ('failure') do

    tests("#describe_snapshot('snap-00000000')").raises(Fog::AWS::Compute::NotFound) do
      AWS[:compute].describe_snapshots('snap-00000000')
    end

    tests("#delete_snapshot('snap-00000000')").raises(Fog::AWS::Compute::NotFound) do
      AWS[:compute].delete_snapshot('snap-00000000')
    end

  end

  @volume.destroy

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
fog-0.3.7 tests/aws/requests/compute/snapshot_tests.rb
fog-0.3.6 tests/aws/requests/compute/snapshot_tests.rb
fog-0.3.5 tests/aws/requests/compute/snapshot_tests.rb
fog-0.3.4 tests/aws/requests/compute/snapshot_tests.rb
fog-0.3.3 tests/aws/requests/compute/snapshot_tests.rb
fog-0.3.2 tests/aws/requests/compute/snapshot_tests.rb
fog-0.3.1 tests/aws/requests/compute/snapshot_tests.rb
fog-0.3.0 tests/aws/requests/compute/snapshot_tests.rb