Sha256: d419c7141f777071cf15d8946f94c171ad4452ae4e5d262b4ef2fd17aa400d08

Contents?: true

Size: 1.06 KB

Versions: 6

Compression:

Stored size: 1.06 KB

Contents

module IntegrationHelper
  def self.fixture_path
    File.expand_path("../integration/edge_gateway/data", File.dirname(__FILE__))
  end

  def self.fixture_file(path)
    File.join(self.fixture_path, path)
  end

  def self.remove_temp_config_files(files_to_delete)
    files_to_delete.each { |f|
      f.unlink
    }
  end

  def self.get_last_task(gateway_name)
    tasks = Vcloud::Core::QueryRunner.new.run('task',
      :filter   => "name==networkConfigureEdgeGatewayServices;" + \
                   "objectName==#{gateway_name}",
      :sortDesc => 'startDate',
      :pageSize => 1,
    )

    raise "Unable to find last vCloud task" if tasks.empty?
    tasks.first
  end

  def self.get_tasks_since(gateway_name, task)
    tasks = Vcloud::Core::QueryRunner.new.run('task',
      :filter   => "name==networkConfigureEdgeGatewayServices;" + \
                   "objectName==#{gateway_name};" + \
                   "startDate=ge=#{task.fetch(:startDate)}",
      :sortDesc => 'startDate',
    )

    tasks.reject! { |t| t.fetch(:href) == task.fetch(:href) }
    tasks
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vcloud-edge_gateway-2.1.1 spec/support/integration_helper.rb
vcloud-edge_gateway-2.1.0 spec/support/integration_helper.rb
vcloud-edge_gateway-1.5.2 spec/support/integration_helper.rb
vcloud-edge_gateway-1.5.0 spec/support/integration_helper.rb
vcloud-edge_gateway-1.4.1 spec/support/integration_helper.rb
vcloud-edge_gateway-1.4.0 spec/support/integration_helper.rb