Sha256: 856df924dc3d39540f2f793a77a2544e452629704cb78f0041a529a9ad17a9d4

Contents?: true

Size: 1.8 KB

Versions: 43

Compression:

Stored size: 1.8 KB

Contents

Shindo.tests('Fog::Compute[:glesys] | ip requests', ['glesys']) do

  @free_ip = nil
  @ips = nil

  tests('success') do

    tests("#ip_list_own()").formats(Glesys::Compute::Formats::Ips::IPLIST) do
      pending if Fog.mocking?
      Fog::Compute[:glesys].ip_list_own.body['response']
    end

    tests("#ip_list_free(:datacenter => 'Falkenberg, :platform => 'Xen', :ipversion => 4)"
    ).formats(Glesys::Compute::Formats::Ips::IPLIST_ALL) do
      pending if Fog.mocking?
      ips = Fog::Compute[:glesys].ip_list_free(
        :datacenter => "Falkenberg",
        :platform   => "Xen",
        :ipversion  => 4
      )
      @free_ip = ips.body['response']['iplist']['ipaddresses'].first
      ips.body['response']
    end

    tests("#ip_take(:datacenter => 'Falkenberg', :platform => 'Xen', :ipversion => 4, :ipaddress => #{@free_ip})"
    ).formats(Glesys::Compute::Formats::Ips::IPLIST_CATCH_RELEASE) do
      pending if Fog.mocking?
      Fog::Compute[:glesys].ip_take(
        :datacenter => "Falkenberg",
        :platform   => "Xen",
        :ipversion  => 4,
        :ipaddress  => @free_ip
      ).body['response']
    end

    tests("#ip_release(:ipaddress => '#{@free_ip}', :ipversion => 4)"
    ).formats(Glesys::Compute::Formats::Ips::IPLIST_CATCH_RELEASE) do
      pending if Fog.mocking?
      Fog::Compute[:glesys].ip_release(
        :ipaddress => @free_ip,
        :ipversion => 4
      ).body['response']
    end

    # ip_details()
    # ip_add()
    # ip_remove()

 end

  tests('failure') do

    tests("#ip_take_argument_error()").raises(Excon::Errors::HTTPStatusError) do
      pending if Fog.mocking?
      ip = Fog::Compute[:glesys].ips.new(
        :datacenter => "Falkenberg",
        :platform   => "Xen",
        :version    => 4,
        :ip         => "127.0.0.1"
      )
      ip.take
    end

  end

end

Version data entries

43 entries across 41 versions & 6 rubygems

Version Path
fog-2.3.0 tests/glesys/requests/compute/ip_tests.rb
fog-ifeel-2.2.0 tests/glesys/requests/compute/ip_tests.rb
fog-2.2.0 tests/glesys/requests/compute/ip_tests.rb
fog-2.1.0 tests/glesys/requests/compute/ip_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/tests/glesys/requests/compute/ip_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/tests/glesys/requests/compute/ip_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/tests/glesys/requests/compute/ip_tests.rb
fog-1.42.1 tests/glesys/requests/compute/ip_tests.rb
fog-2.0.0 tests/glesys/requests/compute/ip_tests.rb
fog-1.42.0 tests/glesys/requests/compute/ip_tests.rb
fog-1.41.0 tests/glesys/requests/compute/ip_tests.rb
fog-1.40.0 tests/glesys/requests/compute/ip_tests.rb
fog-1.39.0 tests/glesys/requests/compute/ip_tests.rb
fog-1.38.0 tests/glesys/requests/compute/ip_tests.rb
fog-1.37.0 tests/glesys/requests/compute/ip_tests.rb
fog-1.36.0 tests/glesys/requests/compute/ip_tests.rb
fog-1.35.0 tests/glesys/requests/compute/ip_tests.rb
fog-2.0.0.pre.0 tests/glesys/requests/compute/ip_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/glesys/requests/compute/ip_tests.rb
fog-1.34.0 tests/glesys/requests/compute/ip_tests.rb