Sha256: aed2e216442ee55da0aa2674781efba0172ef05b2da0f6382c074f21ad7c39f9

Contents?: true

Size: 1.28 KB

Versions: 67

Compression:

Stored size: 1.28 KB

Contents

Shindo.tests("Fog::Compute::HPV2 | volume_attachment model", ['hp', 'v2', 'compute']) do

  service = Fog::Compute.new(:provider => 'HP', :version => :v2)

  @base_image_id = ENV['BASE_IMAGE_ID'] || '7f60b54c-cd15-433f-8bed-00acbcd25a17'

  @server = service.servers.create(:name => 'fogserattachtests', :flavor_id => 100, :image_id => @base_image_id)
  @server.wait_for { ready? }
  @volume = HP[:block_storage_v2].volumes.create(:name => 'fogvolumetest', :size => 1)
  @volume.wait_for { ready? }

  tests('success') do

    tests('#create').succeeds do
      volume_attachment = @server.volume_attachments.create(:server_id => @server.id, :volume_id => @volume.id, :device => '/dev/sdf')
      test('volume attached to server') do
        volume_attachment.server_id == @server.id
      end
    end

    tests('#get').succeeds do
      volume_attachment = @server.volume_attachments.get(@volume.id)
      test('get server in volume attachment') do
        volume_attachment.server_id == @server.id
      end
      test('get volume in volume attachment') do
        volume_attachment.id == @volume.id
      end
    end

    tests('#detach').succeeds do
      volume_attachment = @server.volume_attachments.get(@volume.id)
      volume_attachment.detach
    end

  end

  @volume.destroy
  @server.destroy
end

Version data entries

67 entries across 67 versions & 5 rubygems

Version Path
fog-1.38.0 tests/hp/models/compute_v2/volume_attachment_tests.rb
fog-1.37.0 tests/hp/models/compute_v2/volume_attachment_tests.rb
fog-1.36.0 tests/hp/models/compute_v2/volume_attachment_tests.rb
fog-1.35.0 tests/hp/models/compute_v2/volume_attachment_tests.rb
fog-2.0.0.pre.0 tests/hp/models/compute_v2/volume_attachment_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/hp/models/compute_v2/volume_attachment_tests.rb
fog-1.34.0 tests/hp/models/compute_v2/volume_attachment_tests.rb
fog-1.33.0 tests/hp/models/compute_v2/volume_attachment_tests.rb
fog-1.32.0 tests/hp/models/compute_v2/volume_attachment_tests.rb
fog-1.31.0 tests/hp/models/compute_v2/volume_attachment_tests.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/hp/models/compute_v2/volume_attachment_tests.rb
fog-1.30.0 tests/hp/models/compute_v2/volume_attachment_tests.rb
fog-1.29.0 tests/hp/models/compute_v2/volume_attachment_tests.rb
fog-1.28.0 tests/hp/models/compute_v2/volume_attachment_tests.rb
fog-1.27.0 tests/hp/models/compute_v2/volume_attachment_tests.rb
fog-1.26.0 tests/hp/models/compute_v2/volume_attachment_tests.rb
fog-1.25.0 tests/hp/models/compute_v2/volume_attachment_tests.rb
nsidc-fog-1.24.1 tests/hp/models/compute_v2/volume_attachment_tests.rb
fog-1.24.0 tests/hp/models/compute_v2/volume_attachment_tests.rb
ns-fog-1.22.11 tests/hp/models/compute_v2/volume_attachment_tests.rb