Sha256: 87769223fb4c06b7990d7fcc552d45a74d32c597a4baeb2df71f07f0216e2f35

Contents?: true

Size: 1.7 KB

Versions: 67

Compression:

Stored size: 1.7 KB

Contents

Shindo.tests("Fog::Compute::HPV2 | metadata for images", ['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 => 'fogsermdtests', :flavor_id => 100, :image_id => @base_image_id)
  @server.wait_for { ready? }
  @image = @server.create_image('fogimgmetadatatests', :metadata => {'Meta1' => 'MetaValue1', 'Meta2' => 'MetaValue2'})
  @image.wait_for { ready? }
  @image.reload

  tests('success') do

    tests('#all').succeeds do
      @image.metadata.all
    end

    tests("#get('Meta1')").succeeds do
      pending if Fog.mocking?
      @image.metadata.get('Meta1')
    end

    tests("#update({'Meta3' => 'MetaValue3'})").succeeds do
      @data = @image.metadata.update({'Meta3' => 'MetaValue3'})
      test('metadata has updated correctly') do
        @image.metadata.get('Meta3').value == 'MetaValue3'
      end
    end

    tests("#set({'Meta4' => 'MetaValue4'})").succeeds do
      @data = @image.metadata.set({'Meta4' => 'MetaValue4'})
      test('metadata has set correctly') do
        @image.metadata.get('Meta4').value == 'MetaValue4'
      end
    end

    tests("#save").succeeds do
      m = @image.metadata.new(:key => 'Meta5', :value => 'MetaValue5')
      @data = m.save
      test('metadata has saved correctly') do
        @image.metadata.get('Meta5').value == 'MetaValue5'
      end
    end

    tests("#destroy('Meta5')").succeeds do
      @image.metadata.destroy('Meta5')
      test('metadata has been destroyed') do
        @image.metadata.get('Meta5') == nil
      end
    end

  end

  unless Fog.mocking?
    @image.destroy
  end
  @server.destroy

end

Version data entries

67 entries across 67 versions & 5 rubygems

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