Sha256: 48e072e948acf257c6e787c995bb55dec53c24c5934156638e83e0105604fe8d

Contents?: true

Size: 1.57 KB

Versions: 26

Compression:

Stored size: 1.57 KB

Contents

Shindo.tests('Fog::Rackspace::Networking | virtual_interface_tests', ['rackspace']) do
  @service = Fog::Rackspace::Networking.new

  virtual_interface_format = {
    "virtual_interfaces"=> [{
      "ip_addresses"=> [{
        "network_id"=> String,
        "network_label"=> String,
        "address"=> String
      }],
      "id"=> String,
      "mac_address"=> String
    }]
  }

  begin
    unless Fog.mocking?
      network_id = nil

      @server = @service.servers.create(:name => "fog_virtual_interface_test_#{Time.now.to_i.to_s}",
                                        :flavor_id => rackspace_test_flavor_id(@service),
                                        :image_id => rackspace_test_image_id(@service))
      @server.wait_for { ready? }

      @network = @service.networks.create(:label => "fog_#{Time.now.to_i.to_s}", :cidr => '192.168.0.0/24')
    end

    tests('success') do
      pending if Fog.mocking?

      tests('#create_virtual_interface').formats(virtual_interface_format) do
        response = @service.create_virtual_interface @server.id, @network.id
        body = response.body
        @virtual_network_interface_id = body["virtual_interfaces"].first["id"]
        body
      end
        tests('#list_virtual_interfaces').formats(virtual_interface_format) do
          @service.list_virtual_interfaces(@server.id).body
        end

        tests('#delete_virtual_interfaces').succeeds do
          @service.delete_virtual_interface(@server.id, @virtual_network_interface_id)
        end
      end
  ensure
    @server.destroy if @server
    delete_test_network @network
  end
end

Version data entries

26 entries across 24 versions & 5 rubygems

Version Path
fog-rackspace-0.1.6 tests/rackspace/requests/networking/virtual_interface_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-rackspace-0.1.5/tests/rackspace/requests/networking/virtual_interface_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-rackspace-0.1.5/tests/rackspace/requests/networking/virtual_interface_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-rackspace-0.1.5/tests/rackspace/requests/networking/virtual_interface_tests.rb
fog-rackspace-0.1.5 tests/rackspace/requests/networking/virtual_interface_tests.rb
fog-rackspace-0.1.4 tests/rackspace/requests/networking/virtual_interface_tests.rb
fog-rackspace-0.1.3 tests/rackspace/requests/networking/virtual_interface_tests.rb
fog-rackspace-0.1.2 tests/rackspace/requests/networking/virtual_interface_tests.rb
fog-rackspace-0.1.1 tests/rackspace/requests/networking/virtual_interface_tests.rb
fog-rackspace-0.1.0 tests/rackspace/requests/networking/virtual_interface_tests.rb
fog-1.37.0 tests/rackspace/requests/networking/virtual_interface_tests.rb
fog-1.36.0 tests/rackspace/requests/networking/virtual_interface_tests.rb
fog-1.35.0 tests/rackspace/requests/networking/virtual_interface_tests.rb
fog-2.0.0.pre.0 tests/rackspace/requests/networking/virtual_interface_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/rackspace/requests/networking/virtual_interface_tests.rb
fog-1.34.0 tests/rackspace/requests/networking/virtual_interface_tests.rb
fog-1.33.0 tests/rackspace/requests/networking/virtual_interface_tests.rb
fog-1.32.0 tests/rackspace/requests/networking/virtual_interface_tests.rb
fog-1.31.0 tests/rackspace/requests/networking/virtual_interface_tests.rb
fog-1.30.0 tests/rackspace/requests/networking/virtual_interface_tests.rb