Sha256: 519084de2f61847f2cf441a1d69e6fa3d263fff6858049ca344ae00eecd51e45

Contents?: true

Size: 1.65 KB

Versions: 67

Compression:

Stored size: 1.65 KB

Contents

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

  tests('success') do

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

    tests("#get('Meta1')").succeeds do
      @data = @server.metadata.get('Meta1')
      test('metadata gets correct value') do
        @data.value == 'MetaValue1'
      end
    end

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

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

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

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

  end

  @server.destroy

end

Version data entries

67 entries across 67 versions & 5 rubygems

Version Path
fog-maestrodev-1.19.0.20140107142106 tests/hp/models/compute_v2/metadata_server_tests.rb
fog-maestrodev-1.19.0.20131219203941 tests/hp/models/compute_v2/metadata_server_tests.rb
fog-maestrodev-1.18.0.20131219193542 tests/hp/models/compute_v2/metadata_server_tests.rb
fog-1.19.0 tests/hp/models/compute_v2/metadata_server_tests.rb
fog-maestrodev-1.18.0.20131219033443 tests/hp/models/compute_v2/metadata_server_tests.rb
fog-maestrodev-1.18.0.20131219032002 tests/hp/models/compute_v2/metadata_server_tests.rb
fog-maestrodev-1.18.0.20131219030716 tests/hp/models/compute_v2/metadata_server_tests.rb
fog-maestrodev-1.18.0.20131219022322 tests/hp/models/compute_v2/metadata_server_tests.rb
fog-maestrodev-1.18.0.20131218202447 tests/hp/models/compute_v2/metadata_server_tests.rb
fog-maestrodev-1.18.0.20131209091424 tests/hp/models/compute_v2/metadata_server_tests.rb
fog-maestrodev-1.18.0.20131209090811 tests/hp/models/compute_v2/metadata_server_tests.rb
fog-maestrodev-1.18.0.20131206115947 tests/hp/models/compute_v2/metadata_server_tests.rb
fog-maestrodev-1.18.0.20131205181604 tests/hp/models/compute_v2/metadata_server_tests.rb
fog-maestrodev-1.18.0.20131127194823 tests/hp/models/compute_v2/metadata_server_tests.rb
fog-maestrodev-1.18.0.20131126183714 tests/hp/models/compute_v2/metadata_server_tests.rb
fog-maestrodev-1.18.0.20131126122111 tests/hp/models/compute_v2/metadata_server_tests.rb
fog-maestrodev-1.18.0.20131125111730 tests/hp/models/compute_v2/metadata_server_tests.rb
fog-maestrodev-1.18.0.20131125083406 tests/hp/models/compute_v2/metadata_server_tests.rb
fog-maestrodev-1.18.0.20131123105121 tests/hp/models/compute_v2/metadata_server_tests.rb
fog-maestrodev-1.18.0.20131122203507 tests/hp/models/compute_v2/metadata_server_tests.rb