Sha256: 4efea8a3a207c5403122cbad5cba4c98a14d05a1a7c1fa2e170cc0d6551e223f

Contents?: true

Size: 1.47 KB

Versions: 36

Compression:

Stored size: 1.47 KB

Contents

Shindo.tests('Fog::Compute::RackspaceV2 | address requests', ['rackspace']) do

  @service = Fog::Compute.new(:provider => 'Rackspace', :version => 'V2')
  image_id  = rackspace_test_image_id(@service)
  flavor_id = rackspace_test_flavor_id(@service)
  
  tests('success') do
    unless Fog.mocking?
      @server = @service.servers.create(:flavor_id => flavor_id, :image_id => image_id, :name => "address-tests-#{Time.now.to_i}")
      @server.wait_for { ready? }
      @server_id = @server.id
    else
      @server_id = 42
    end
    
    address_format =  { "addresses"=> { 
      "private" => [{"addr" => String, "version" => Integer}], 
      "public" => [{"addr" => String, "version" => Integer }, {"addr"=> String, "version" => Integer}]}
    }

    begin 
      tests("#list_addresses(#{@server_id})").formats(address_format) do
         @service.list_addresses(@server_id).body
      end
      
      tests("#list_addresses_by_network(#{@server_id}, 'private')").formats(address_format["addresses"].reject {|k,v| k != "private"}) do
        @service.list_addresses_by_network(@server_id, "private").body
      end
    ensure
      @server.destroy if @server
    end

  end

  tests('failure') do
    tests('#list_addresses(0)').raises(Fog::Compute::RackspaceV2::NotFound) do
       @service.list_addresses(0)
    end
    tests("#list_addresses_by_network(0, 'private')").raises(Fog::Compute::RackspaceV2::NotFound) do
      @service.list_addresses_by_network(0, 'private')
    end

  end

end

Version data entries

36 entries across 36 versions & 2 rubygems

Version Path
fog-1.22.0 tests/rackspace/requests/compute_v2/address_tests.rb
fog-1.21.0 tests/rackspace/requests/compute_v2/address_tests.rb
fog-maestrodev-1.20.0.20140305101839 tests/rackspace/requests/compute_v2/address_tests.rb
fog-maestrodev-1.20.0.20140305101305 tests/rackspace/requests/compute_v2/address_tests.rb
fog-maestrodev-1.19.0.20140212012611 tests/rackspace/requests/compute_v2/address_tests.rb
fog-1.20.0 tests/rackspace/requests/compute_v2/address_tests.rb
fog-maestrodev-1.19.0.20140110004459 tests/rackspace/requests/compute_v2/address_tests.rb
fog-maestrodev-1.19.0.20140110003812 tests/rackspace/requests/compute_v2/address_tests.rb
fog-maestrodev-1.19.0.20140109202555 tests/rackspace/requests/compute_v2/address_tests.rb
fog-maestrodev-1.19.0.20140107192102 tests/rackspace/requests/compute_v2/address_tests.rb
fog-maestrodev-1.19.0.20140107142106 tests/rackspace/requests/compute_v2/address_tests.rb
fog-maestrodev-1.19.0.20131219203941 tests/rackspace/requests/compute_v2/address_tests.rb
fog-maestrodev-1.18.0.20131219193542 tests/rackspace/requests/compute_v2/address_tests.rb
fog-1.19.0 tests/rackspace/requests/compute_v2/address_tests.rb
fog-maestrodev-1.18.0.20131219033443 tests/rackspace/requests/compute_v2/address_tests.rb
fog-maestrodev-1.18.0.20131219032002 tests/rackspace/requests/compute_v2/address_tests.rb
fog-maestrodev-1.18.0.20131219030716 tests/rackspace/requests/compute_v2/address_tests.rb
fog-maestrodev-1.18.0.20131219022322 tests/rackspace/requests/compute_v2/address_tests.rb
fog-maestrodev-1.18.0.20131218202447 tests/rackspace/requests/compute_v2/address_tests.rb
fog-maestrodev-1.18.0.20131209091424 tests/rackspace/requests/compute_v2/address_tests.rb