Sha256: ced18ebd524a25a2790c9216c437f14d149abfc0a1ed5fd7697999429d4010cd

Contents?: true

Size: 1.65 KB

Versions: 45

Compression:

Stored size: 1.65 KB

Contents

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

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

  @snapshots_format = {
    'requestId'   => String,
    'snapshotSet' => [@snapshot_format.merge('tagSet' => {})]
  }

  @volume = Fog::Compute[:aws].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 = Fog::Compute[:aws].create_snapshot(@volume.identity).body
      @snapshot_id = data['snapshotId']
      data
    end

    Fog.wait_for { Fog::Compute[:aws].snapshots.get(@snapshot_id) }
    Fog::Compute[:aws].snapshots.get(@snapshot_id).wait_for { ready? }

    tests("#describe_snapshots").formats(@snapshots_format) do
      Fog::Compute[:aws].describe_snapshots.body
    end

    tests("#describe_snapshots('snapshot-id' => '#{@snapshot_id}')").formats(@snapshots_format) do
      Fog::Compute[:aws].describe_snapshots('snapshot-id' => @snapshot_id).body
    end

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

  end
  tests('failure') do

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

  end

  @volume.destroy

end

Version data entries

45 entries across 45 versions & 14 rubygems

Version Path
fog-nirvanix-1.8.2 tests/aws/requests/compute/snapshot_tests.rb
fog-nirvanix-1.8.1 tests/aws/requests/compute/snapshot_tests.rb
fog-parser-fix-1.6.1 tests/aws/requests/compute/snapshot_tests.rb
fog-test-again-1.6.0 tests/aws/requests/compute/snapshot_tests.rb
fog-parser-fix-1.6.0 tests/aws/requests/compute/snapshot_tests.rb
fog-sgonyea-1.8.1 tests/aws/requests/compute/snapshot_tests.rb
fog-1.8.0 tests/aws/requests/compute/snapshot_tests.rb
fog-maestrodev-1.7.0.20121114190951 tests/aws/requests/compute/snapshot_tests.rb
fog-1.7.0 tests/aws/requests/compute/snapshot_tests.rb
fog-1.6.0 tests/aws/requests/compute/snapshot_tests.rb
fog-1.5.0 tests/aws/requests/compute/snapshot_tests.rb
rackspace-fog-1.4.2 tests/aws/requests/compute/snapshot_tests.rb
fog-1.4.0 tests/aws/requests/compute/snapshot_tests.rb
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/tests/aws/requests/compute/snapshot_tests.rb
michiels-fog-1.3.1 tests/aws/requests/compute/snapshot_tests.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/tests/aws/requests/compute/snapshot_tests.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/tests/aws/requests/compute/snapshot_tests.rb
fog-1.3.1 tests/aws/requests/compute/snapshot_tests.rb
fog-1.3.0 tests/aws/requests/compute/snapshot_tests.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/tests/aws/requests/compute/snapshot_tests.rb