Sha256: 54b7e8d1470f7517819d40159cdf54360b76e8840f1d3579d8a244f88852dd96

Contents?: true

Size: 1.83 KB

Versions: 26

Compression:

Stored size: 1.83 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

26 entries across 26 versions & 4 rubygems

Version Path
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-1.33.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-1.32.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-1.31.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-1.30.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-1.29.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-1.28.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-1.27.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-1.26.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-1.25.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
nsidc-fog-1.24.1 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-1.24.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb
ns-fog-1.22.11 tests/brightbox/requests/compute/database_snapsnot_tests.rb
ns-fog-1.22.10 tests/brightbox/requests/compute/database_snapsnot_tests.rb
ns-fog-1.22.9 tests/brightbox/requests/compute/database_snapsnot_tests.rb
ns-fog-1.22.8 tests/brightbox/requests/compute/database_snapsnot_tests.rb
ns-fog-1.22.7 tests/brightbox/requests/compute/database_snapsnot_tests.rb
ns-fog-1.22.6 tests/brightbox/requests/compute/database_snapsnot_tests.rb
fog-1.23.0 tests/brightbox/requests/compute/database_snapsnot_tests.rb