Sha256: 1f1b7beafe584ac6877d7fe78ecadf2529d71e87d819a160caee0a9bfbb2a8af

Contents?: true

Size: 1.82 KB

Versions: 16

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("#destroy_database_snapshot('#{@database_snapshot_id}')") do
      result = service.destroy_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

16 entries across 14 versions & 3 rubygems

Version Path
fog-brightbox-1.0.0.rc2 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-1.0.0.rc1 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-0.16.1 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-0.16.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-brightbox-0.15.0/tests/brightbox/requests/compute/database_snapsnot_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-brightbox-0.15.0/tests/brightbox/requests/compute/database_snapsnot_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-brightbox-0.15.0/tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-0.15.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-0.14.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-0.13.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-0.12.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-0.11.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-0.10.1 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-0.10.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-brightbox-0.9.0/tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-brightbox-0.9.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb