Sha256: f6d17252b4aabb8b4e45a659b42c855009cdd5b6b3160ae5fd542f9d559ce3b8

Contents?: true

Size: 1.56 KB

Versions: 67

Compression:

Stored size: 1.56 KB

Contents

Shindo.tests("Fog::Compute::HPV2 | server address requests", ['hp', 'v2', 'compute']) do

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

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

  tests('success') do
    @server_name = 'fogaddresstests'
    @server_id = nil

    # check to see if there are any existing servers, otherwise create one
    if (data = service.list_servers(:status => 'ACTIVE').body['servers'][0])
      @server_id = data['id']
    else
      #@server = service.servers.create(:name => @server_name, :flavor_id => 100, :image_id => @base_image_id)
      #@server.wait_for { ready? }
      data = service.create_server(@server_name, 100, @base_image_id).body['server']
      @server_id = data['id']
    end

    # the network name is currently named 'private'
    tests("#list_server_addresses(#{@server_id})").formats({'addresses' => {'hpcloud' => [{'version' => Integer, 'addr' => String}]}}) do
      service.list_server_addresses(@server_id).body
    end

    tests("#list_server_addresses_by_network(#{@server_id}, 'network_name')").succeeds do
      service.list_server_addresses_by_network(@server_id, 'network_name').body
    end

    service.delete_server(@server_id)

  end

  tests('failure') do

    tests('#list_server_addresses(0)').raises(Fog::Compute::HPV2::NotFound) do
      service.list_server_addresses(0)
    end

    tests("#list_server_addresses_by_network(0, 'network_name')").raises(Fog::Compute::HPV2::NotFound) do
      service.list_server_addresses_by_network(0, 'network_name')
    end

  end

end

Version data entries

67 entries across 67 versions & 5 rubygems

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