Sha256: 05605c3f86eda3f809a594c947fa0385169f1bc8bfebb2efb5461bff5d4c8947

Contents?: true

Size: 1.82 KB

Versions: 20

Compression:

Stored size: 1.82 KB

Contents

Shindo.tests("Fog::Compute[:brightbox] | database snapshot requests", ["brightbox"]) do
  pending if Fog.mocking?

  service = Fog::Compute[:brightbox]

  tests("success") do
    # Create a Database Server, then snapshot it
    database_server = service.database_servers.create
    database_server.wait_for { ready? }
    service.snapshot_database_server(database_server.id)

    tests("#list_database_snapshots") do
      result = service.list_database_snapshots
      data_matches_schema(Brightbox::Compute::Formats::Collection::DATABASE_SNAPSHOTS, :allow_extra_keys => true) { result }
      @database_snapshot_id = result.last["id"]
    end

    # Can't delete the server until snapshot is finished
    service.database_snapshots.get(@database_snapshot_id).wait_for { ready? }
    database_server.destroy

    tests("#get_database_snapshot('#{@database_snapshot_id}')") do
      result = service.get_database_snapshot(@database_snapshot_id)
      data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SNAPSHOT, :allow_extra_keys => true) { result }
    end

    update_options = {
      :name => "New name"
    }
    tests("#update_database_snapshot('#{@database_snapshot_id}', update_options)") do
      result = service.update_database_snapshot(@database_snapshot_id, update_options)
      data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SNAPSHOT, :allow_extra_keys => true) { result }
    end

    tests("#delete_database_snapshot('#{@database_snapshot_id}')") do
      result = service.delete_database_snapshot(@database_snapshot_id)
      data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SNAPSHOT, :allow_extra_keys => true) { result }
    end
  end

  tests("failure") do
    tests("get_database_snapshot").raises(Excon::Errors::NotFound) do
      service.get_database_snapshot("dbs-00000")
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
fog-brightbox-1.10.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-1.9.1 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-1.9.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-1.8.2 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-1.8.1 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-1.8.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-1.7.3 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-1.7.2 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-1.7.1 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-1.7.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-1.6.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-1.5.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-1.5.0.rc1 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-1.4.2 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-1.4.1 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-1.4.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-1.3.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-1.2.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-1.1.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-1.0.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb